Closed
Description
Is this a regression?
- Yes, this behavior used to work in the previous version
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)
returnsnumber | undefined
, even though the implementation always yieldsnumber
.
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): *