web-components
web-components copied to clipboard
[time-picker] Don't adjust values that are out of min / max limits
Describe your motivation
Currently, if you initialize time-picker
with a value that is out of limits specified by the min
and max
properties, it will try to adjust the value to the closest valid time. However, this behavior is different from date-picker
which in that case only marks itself invalid, not doing anything with the value.
Compare their behavior in the following example:
<script type="module">
import '@vaadin/time-picker';
import '@vaadin/date-picker';
</script>
<vaadin-time-picker value="15:00" min="18:00"></vaadin-time-picker>
<vaadin-date-picker value="2022-01-01" min="2030-0-01"></vaadin-date-picker>
![image](https://user-images.githubusercontent.com/5039436/178520685-175b5f5f-650e-45bf-aa86-7e76b1da8b9d.png)
Describe the solution you'd like
It is unexpected that time-picker
adjusts value
on its own without any notice. So I would propose that time-picker
would mark itself invalid when its value is out of limits and leave the value untouched.
Describe alternatives you've considered
No response
Additional context
No response