{{ message }}
Repository navigation
Conversation
With allowInput, documentClick commits what the user typed by calling setDate with triggerChange=false, so the value silently changes: no onChange hook, no change/input event on the input, no onValueUpdate. Anything bound to the field (a framework model, a form listener) never learns the date moved. Pressing Enter or leaving with Tab do announce the same edit, so the field is only silent for the most common gesture. onBlur cannot cover the case on its own. Clicking a non-focusable element commits the value without ever blurring the input, and when a blur does follow, documentClick has already applied the value, leaving onBlur's `valueChanged` guard nothing to detect. Trigger the change from documentClick under the same guard onBlur uses, so a commit that moved the value is announced exactly once and a dismissal that changed nothing stays silent. Fixes flatpickr#2941
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.

With allowInput, documentClick commits what the user typed by calling
setDate with triggerChange=false, so the value silently changes: no
onChange hook, no change/input event on the input, no onValueUpdate.
Anything bound to the field (a framework model, a form listener) never
learns the date moved. Pressing Enter or leaving with Tab do announce
the same edit, so the field is only silent for the most common gesture.
onBlur cannot cover the case on its own. Clicking a non-focusable
element commits the value without ever blurring the input, and when a
blur does follow, documentClick has already applied the value, leaving
onBlur's
valueChangedguard nothing to detect.Trigger the change from documentClick under the same guard onBlur uses,
so a commit that moved the value is announced exactly once and a
dismissal that changed nothing stays silent.
Fixes #2941