-
Notifications
You must be signed in to change notification settings - Fork 6.8k
fix(slider): displayWith function never called with "null" #16707
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(slider): displayWith function never called with "null" #16707
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's been a while since I added that input, but from what I remember, the case when the value can be null is when the ControlValueAccessor
associated with the slider is reset. There might be something down the line that coerces it to 0 though.
@crisbeto Yeah unless I miss something, the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
If this doesn't break anything in Google we can consider it safe for a patch release
Caretaker note: if the API change breaks anything in Google, bump this PR to |
Presubmits passed, can be merged as patch. Just needs rebase |
Currently the "displayWith" function for a `MatSlider` is typed in a way that implies that the function is sometimes called with null as value. This is never the case because the `value` property of the slider always returns a number but is just typed as `null`-able because getters and setters cannot have different types. This fixes the type for the `displayWith` function as it will never be called with `null`.
1b0ace4
to
d4a2d2d
Compare
@andrewseguin Rebased. |
…6707) Currently the "displayWith" function for a `MatSlider` is typed in a way that implies that the function is sometimes called with null as value. This is never the case because the `value` property of the slider always returns a number but is just typed as `null`-able because getters and setters cannot have different types. This fixes the type for the `displayWith` function as it will never be called with `null`.
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Currently the "displayWith" function for a
MatSlider
is typedin a way that implies that the function is sometimes called with
null as value. This is never the case because the
value
propertyof the slider always returns a number but is just typed as
null
-ablebecause getters and setters cannot have different types.
This fixes the type for the
displayWith
function as it will never becalled with
null
.@jelbourn Not sure what the best target for this PR would be. It's technically a fix but I could also see this as breaking for applications with
strictFunctionTypes
and Ivy's strict input type checking enabled