You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug] DateInput, DateTimeInput: a nonexistent or out-of-range date errors mid-typing, before Enter or blur #10367
Since 0.7.9 DateInput and DateTimeInput reject typed text that names a date that doesn't exist, or one min, max or dateConstraints rule out, as soon as the text is complete, while focus is still in the field. Unreadable and incomplete text waits for Enter or blur. typedDateError in useTypedDate.ts returns nonexistent or outOfRange when result.isComplete || isCommitted, and the field then shows and announces the error and sets aria-invalid.
A person who types 31/12/2026 into a field with max="2026-12-30" and means to correct it before leaving the field gets an error mid-entry. Forms that validate on blur and submit can't keep that timing: there is no option to defer these errors to commit, as unreadable text already is.
Expected: a nonexistent or out-of-range date shows and announces its error on Enter or blur, as unreadable text does; or a prop that sets this timing.
The current timing stays the default: a date the calendar doesn't have, or one outside min, max, or dateConstraints, shows its error as soon as the date is complete.
For forms that validate on blur, Astryx will add a validation-timing option shared by every input that checks its own entries, not only dates: validationTiming: 'complete' | 'commit' on DateInput, DateTimeInput, TimeInput, and NumberInput, defaulting to 'complete'. FormLayout gets a form-wide defaultValidationTiming, and a field's own prop wins. validationTiming="commit" gives the behavior this issue asks for.
A spec record for the option comes first, then the implementation.
#10575 and #11281 make commit timing the only behavior, so they would need to become this option instead.
Naming update: the option is validationBehavior: 'complete' | 'commit', with defaultValidationBehavior on FormLayout and an exported ValidationBehavior type. It follows Astryx's rule that a prop choosing how a component responds to input is named <thing>Behavior. The values and the default are unchanged.
Naming update: the values are now validationBehavior: 'complete' | 'blur-or-enter' (the form-level default stays defaultValidationBehavior). 'blur-or-enter' names both triggers: the error appears when the person leaves the field or presses Enter. Separate 'blur' and 'enter' values would allow bad modes. With Enter only, someone who tabs away from a wrong entry is never told. With blur only, Enter accepts wrong text with no error. The behavior and the default are unchanged.
Naming update: the prop is entryErrorBehavior: 'complete' | 'blur-or-enter', with defaultEntryErrorBehavior on FormLayout and an exported EntryErrorBehavior type. The new name avoids React Aria's validationBehavior, which means something else (native versus ARIA validation). It also matches the existing onEntryErrorChange, and it says that the prop controls when the field's own entry error shows, not when validation runs. The behavior and the default are unchanged.
Activity
nynexman4464 commentedon Nov 11, 2026
Thanks for the report. The decision:
min,max, ordateConstraints, shows its error as soon as the date is complete.validationTiming: 'complete' | 'commit'onDateInput,DateTimeInput,TimeInput, andNumberInput, defaulting to'complete'.FormLayoutgets a form-widedefaultValidationTiming, and a field's own prop wins.validationTiming="commit"gives the behavior this issue asks for.#10575 and #11281 make commit timing the only behavior, so they would need to become this option instead.
nynexman4464 commentedon Nov 11, 2026
Naming update: the option is
validationBehavior: 'complete' | 'commit', withdefaultValidationBehavioronFormLayoutand an exportedValidationBehaviortype. It follows Astryx's rule that a prop choosing how a component responds to input is named<thing>Behavior. The values and the default are unchanged.nynexman4464 commentedon Nov 12, 2026
Naming update: the values are now
validationBehavior: 'complete' | 'blur-or-enter'(the form-level default staysdefaultValidationBehavior).'blur-or-enter'names both triggers: the error appears when the person leaves the field or presses Enter. Separate'blur'and'enter'values would allow bad modes. With Enter only, someone who tabs away from a wrong entry is never told. With blur only, Enter accepts wrong text with no error. The behavior and the default are unchanged.nynexman4464 commentedon Nov 12, 2026
Naming update: the prop is
entryErrorBehavior: 'complete' | 'blur-or-enter', withdefaultEntryErrorBehavioronFormLayoutand an exportedEntryErrorBehaviortype. The new name avoids React Aria'svalidationBehavior, which means something else (native versus ARIA validation). It also matches the existingonEntryErrorChange, and it says that the prop controls when the field's own entry error shows, not when validation runs. The behavior and the default are unchanged.duytbp commentedon Nov 14, 2026
Fixed in v0.7.16 by
entryErrorBehavior="blur-or-enter". Thank you!