Skip to content

[time-picker] Add option to validate by step #738

@Haprog

Description

@Haprog

Currently the step property in time picker only affects two things:

  1. options in the dropdown (or hides it if step is less than 15 min)
  2. the value resolution/precision (format of the value property; does it include milliseconds, seconds, minutes)

But it doesn't affect validity of the value (unlike step in vaadin-number-field). So if you e.g. set step to 3600 (1 hour) the dropdown shows only exact hours, but you can still input for example "10:05" and it will stay in the input and the input will stay valid and value property will get updated to "10:05".

The current behaviour is probably ok as a default and has use cases when you might want to show only some values in the dropdown but want to allow more precise manual input.

My suggestion is to add a new feature like validate-by-step which would make the field become invalid if the given value does not match the step (in cases when you only want to allow specific exact intervals of values to be given).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions