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 typed date's error replaces the host's status, and nothing reports why #10366
Since 0.7.9 DateInput and DateTimeInput show their own message for typed text that names a date that doesn't exist (02/31/2026) or that min, max or dateConstraints rule out, and that message replaces the host's status: useTypedDate.ts sets fieldStatus = typedStatus ?? status. The host can't word the error itself, and it can't learn why the text was refused: onChange isn't called, and nothing reports the rejection's kind. A form that words its own date errors ("Nhập ngày hợp lệ" for a date that doesn't exist, its own line for a range) can only match Astryx's translated text, which changes with the locale and the release.
Expected:
A host status stays the message the field shows and announces. Astryx's typed message applies when the host passes none.
A callback reports each typed rejection with a locale-independent kind (unreadable, incomplete, nonexistent, outOfRange, unavailable for a dateConstraints day) and the text, and reports its end, so the host can set that status. For example onTypedDateError?: (error: {kind, text} | null) => void.
I reproduced the status override locally and have been exploring a fix for both DateInput and DateTimeInput. A prototype preserves a caller-provided status and reports typed rejections through an optional callback with a locale-independent kind and the entered text; it reports null when the rejection clears.
The current component specification explicitly prioritizes the typed rejection over the caller's status. Would you be open to changing that contract and adding a callback like the one proposed here? In the prototype, when the caller supplies a status message, that message is announced without also announcing the built-in rejection; otherwise the existing typed-rejection announcement remains. This avoids duplicate announcements when the caller derives its message from the callback.
The prototype passes focused component tests and a Chromium accessibility-tree check. The full suite is not green locally: a CLI global/local upgrade-notice test fails in the separate node test run.
A few facts that may help settle the contract and test the prototype (all on main at fb2437f and 0.7.11, where fieldStatus = typedStatus ?? status is unchanged at useTypedDate.ts:336):
TimeInput already lets the caller's status win. A rejected typed time sets aria-invalid and announces "Invalid time" through its own alert, but never replaces status (TimeInput.tsx#L868-L886). Reversing the precedence would make DateInput and DateTimeInput match their sibling.
A non-error caller status. With "any caller status wins", a field with a standing warning or success status (for example "This date is a public holiday") shows that message for 02/31/2026, and the person only sees the invalid styling. It may be worth deciding whether only an error status wins, or only a caller that passes the new callback.
Inside an InputGroup. A grouped DateInput renders no Field (DateInput.tsx#L1020) and passes isStatusAnnounced: !inputGroup, so a status on the DateInput itself is neither shown nor announced there. If the alert goes silent whenever a caller status is set, a grouped DateInput with its own status would announce the rejection nowhere. DateTimeInput passes isStatusAnnounced: true unconditionally.
Rejections that start or end without an input event. A new min, max or dateConstraints can make kept text out of range or valid again, isDisabled clears the rejection (typedDateError isn't called while disabled), and a new value or a calendar pick drops the typed text. A callback that reports only from input, Enter and blur would miss these and leave a caller's derived status stale.
Surfaces with no typed text. The native and touch pickers never produce a typed rejection, so the callback never fires there; the docs may want to say so.
Downstream, we currently carry a patch on 0.7.10 that swaps the precedence to status ?? typedStatus and maps rejections to our own messages, which is the use case the callback's locale-independent kind would serve.
Thanks for the report and the detailed edge cases. The decision:
DateInput and DateTimeInput get onEntryErrorChange?: (error: {kind, text, date?} | null) => void. kind is one of unreadable, incomplete, nonexistent, outOfRange, or unavailable, and date is the Gregorian ISO date when the text names one. It fires whenever the rejection changes, including from a new min, max, or dateConstraints, disabling the field, a new value, or a calendar pick, and reports null when the rejection clears. The native and touch pickers produce no typed rejections, so it never fires there.
When the app passes onEntryErrorChange, an app status of type error is the message the field shows and announces, and Astryx's own message is the fallback. A warning or success status never replaces a rejection. Without the callback, the field behaves as it does today.
Each message is announced once. Inside an InputGroup, the field's own alert announces whichever message wins, so a rejection is never silent.
The built-in wording also changes: a date the calendar doesn't have reads "Enter a real date", and names the calendar only when it differs from the provider's. A pull request implementing this will follow.
Activity
AdhamAfis commentedon Nov 7, 2026
I reproduced the status override locally and have been exploring a fix for both DateInput and DateTimeInput. A prototype preserves a caller-provided status and reports typed rejections through an optional callback with a locale-independent kind and the entered text; it reports null when the rejection clears.
The current component specification explicitly prioritizes the typed rejection over the caller's status. Would you be open to changing that contract and adding a callback like the one proposed here? In the prototype, when the caller supplies a status message, that message is announced without also announcing the built-in rejection; otherwise the existing typed-rejection announcement remains. This avoids duplicate announcements when the caller derives its message from the callback.
The prototype passes focused component tests and a Chromium accessibility-tree check. The full suite is not green locally: a CLI global/local upgrade-notice test fails in the separate node test run.
duytbp commentedon Nov 8, 2026
A few facts that may help settle the contract and test the prototype (all on
mainat fb2437f and 0.7.11, wherefieldStatus = typedStatus ?? statusis unchanged atuseTypedDate.ts:336):aria-invalidand announces "Invalid time" through its own alert, but never replacesstatus(TimeInput.tsx#L868-L886). Reversing the precedence would make DateInput and DateTimeInput match their sibling.warningorsuccessstatus (for example "This date is a public holiday") shows that message for02/31/2026, and the person only sees the invalid styling. It may be worth deciding whether only anerrorstatus wins, or only a caller that passes the new callback.Field(DateInput.tsx#L1020) and passesisStatusAnnounced: !inputGroup, so astatuson the DateInput itself is neither shown nor announced there. If the alert goes silent whenever a caller status is set, a grouped DateInput with its ownstatuswould announce the rejection nowhere. DateTimeInput passesisStatusAnnounced: trueunconditionally.min,maxordateConstraintscan make kept text out of range or valid again,isDisabledclears the rejection (typedDateErrorisn't called while disabled), and a newvalueor a calendar pick drops the typed text. A callback that reports only from input, Enter and blur would miss these and leave a caller's derived status stale.Downstream, we currently carry a patch on 0.7.10 that swaps the precedence to
status ?? typedStatusand maps rejections to our own messages, which is the use case the callback's locale-independent kind would serve.GauravPawar101 commentedon Nov 10, 2026
Hey, I would like to work on this if issue out of triage or might need contributor to implement according to them.
nynexman4464 commentedon Nov 11, 2026
Thanks for the report and the detailed edge cases. The decision:
DateInputandDateTimeInputgetonEntryErrorChange?: (error: {kind, text, date?} | null) => void.kindis one ofunreadable,incomplete,nonexistent,outOfRange, orunavailable, anddateis the Gregorian ISO date when the text names one. It fires whenever the rejection changes, including from a newmin,max, ordateConstraints, disabling the field, a newvalue, or a calendar pick, and reportsnullwhen the rejection clears. The native and touch pickers produce no typed rejections, so it never fires there.onEntryErrorChange, an appstatusof typeerroris the message the field shows and announces, and Astryx's own message is the fallback. Awarningorsuccessstatus never replaces a rejection. Without the callback, the field behaves as it does today.InputGroup, the field's own alert announces whichever message wins, so a rejection is never silent.The built-in wording also changes: a date the calendar doesn't have reads "Enter a real date", and names the calendar only when it differs from the provider's. A pull request implementing this will follow.
feat(DateInput, DateTimeInput): report typed rejections through onEnt…