You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
fix(input[type=range]): set model to 50 if input value defaults to 50
When the model value is undefined or null, browsers that fully implement range will set its value to 50. This causes a mismatch between the model and the view. It also means that the input cannot be "empty", that means it will never show up as required because it always has a value. This is obviously problematic if the application that won't be able to distinguish between a null value and the default value of 50.
This commit sets the model to 50 after a call to $render detects that the value to be set was empty. This is done via $setViewValue, so parser and validators run.
It also means that when the range model is also bound to a number input, this input can never be cleared, as clearing it will trigger the reset to 50 in the range input.
0 commit comments