Is this a regression?
The previous version in which this bug was not present was
No response
Description
coerceNumberProperty(thing, undefined) works the same way as coerceNumberProperty(thing), so it yields 0 if the thing isn't coercible to number. This is quite unexpected, because:
- In all other cases the fallback argument is respected.
- The return type is different:
coerceNumberProperty(thing, undefined) returns number | undefined, even though the implementation always yields number.
Reproduction
StackBlitz link:
Steps to reproduce:
1.
2.
Expected Behavior
Fallback argument should be respected even for undefined.
Actual Behavior
undefined isn't respected as a fallback.
Environment
- Angular: 17.0.6
- CDK/Material: 17.1.0
- Browser(s): *
- Operating System (e.g. Windows, macOS, Ubuntu): *