feat(Range/DateField): support intering invalid dates#268
Open
feat(Range/DateField): support intering invalid dates#268
Conversation
Contributor
|
Preview is ready. |
595684e to
e81f5a7
Compare
Contributor
|
🎭 Tests Report is ready. |
Temporarily allow incomplete or invalid date inputs—where some fields are empty or the entered date/time doesn’t exist (for example, February 31 or 2:00am during a forward DST shift). Rather than forcing the value to be valid while the user is typing, we hold these intermediate values internally and don’t emit them via onChange until the user blurs the field. On blur, we normalize the input to a valid date/time.This makes it easier to edit dates that are briefly invalid during normal typing (like changing the day before updating the month). We still emit onChange in real time whenever we can, but not when the displayed value is incomplete or invalid. BREAKING CHANGES: - state returned by `useDateFieldState`/`useRangeDateFieldState` is changed;
e81f5a7 to
dc73f11
Compare
korvin89
approved these changes
Feb 10, 2026
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.
Temporarily allow incomplete or invalid date inputs—where some fields are empty or the entered date/time doesn’t exist (for example, February 31 or 2:00am during a forward DST shift). Rather than forcing the value to be valid while the user is typing, we hold these intermediate values internally and don’t emit them via onChange until the user blurs the field. On blur, we normalize the input to a valid date/time.
This makes it easier to edit dates that are briefly invalid during normal typing (like changing the day before updating the month). We still emit onChange in real time whenever we can, but not when the displayed value is incomplete or invalid.
BREAKING CHANGES:
useDateFieldState/useRangeDateFieldStateischanged;
This is part 1 of 1 in a stack made with GitButler: