diff --git a/src/cdk/coercion/number-property.ts b/src/cdk/coercion/number-property.ts index 2452ab2f15a8..50b5ff8d0841 100644 --- a/src/cdk/coercion/number-property.ts +++ b/src/cdk/coercion/number-property.ts @@ -16,7 +16,10 @@ export type NumberInput = string | number | null | undefined; export function coerceNumberProperty(value: any): number; export function coerceNumberProperty(value: any, fallback: D): number | D; export function coerceNumberProperty(value: any, fallbackValue = 0) { - return _isNumberValue(value) ? Number(value) : fallbackValue; + if (_isNumberValue(value)) { + return Number(value); + } + return arguments.length === 2 ? fallbackValue : 0; } /**