Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
Haprog opened this issue Feb 6, 2020 · 2 comments
Closed

Comments

@Haprog
Copy link
Contributor

Haprog commented Feb 6, 2020

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
Copy link
Contributor Author

Haprog commented Feb 27, 2020

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

@vaadin-bot vaadin-bot transferred this issue from vaadin/vaadin-date-picker May 19, 2021
@web-padawan web-padawan changed the title Manually set invalid state is automatically removed on blur [date-picker] Manually set invalid state is automatically removed on blur May 21, 2021
@yuriy-fix
Copy link
Contributor

It's an intended behaviour in the latest version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants