fix: always validate programmatic date updates for picker components #927
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
HTML constraint validation can apply even if we're not using the native date picker, so I don't see a strong reason to skip
checkHtml5Validity()
.Proposed Changes
Previously, date and time pickers would only try to clear their constraint validation messages on direct user updates or
blur
events when in desktop mode, not on programmatic updates. In the video below, note that I have to blur the field before the validation message fixes itself:before.webm
This is inconsistent with the behavior of other inputs, which will clear their validation messages even if not updated due to direct user input.
after.webm
Here's the code I used to demonstrate the issue: