web-components icon indicating copy to clipboard operation
web-components copied to clipboard

[time-picker] Don't adjust values that are out of min / max limits

Open vursen opened this issue 2 years ago • 0 comments

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

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

vursen avatar Jul 12 '22 14:07 vursen