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

[date-picker] Manually set invalid state is automatically removed on blur

Open Haprog opened this issue 5 years ago • 1 comments

Description

If manually setting datePicker.invalid = true the field becomes invalid and red, but then if the field is focused and then unfocused it automatically becomes valid again and not red anymore. This doesn't seem right. E.g. vaadin-text-field and vaadin-time-picker both keep it as invalid even if the user focuse and unfocuses/blurs the field.

Expected outcome

When <vaadin-date-picker> has been explicitly set as invalid, it should not become valid just by focusing and unfocusing it.

Actual outcome

When <vaadin-date-picker> has been explicitly set as invalid, it becomes valid just by focusing and unfocusing it.

Steps to reproduce

https://cdn.vaadin.com/vaadin-date-picker/4.0.6/demo/#date-picker-basic-demos

  1. Inspect the first vaadin-date-picker on the page and make it invalid by executing $0.invalid = true (notice the text field will become red).
  2. Click on the text field of the date picker to focus it (or focus it via keyboard)
  3. Unfocus the date picker either by clicking outside of it or navigating out of it via keyboard (notice the field is not red anymorebut it should be).

Other

Might be related to vaadin/vaadin-date-picker#696.

Haprog avatar Feb 06 '20 14:02 Haprog

I checked that this is still a valid issue also with date picker 4.0.7.

Haprog avatar Feb 27 '20 10:02 Haprog

It's an intended behaviour in the latest version.

yuriy-fix avatar Dec 05 '23 09:12 yuriy-fix