fix(DatePicker): error handling & a11y polish - #3395
Open
aresnik11 wants to merge 4 commits into
Open
Conversation
… button - Announce full weekday names in calendar headers instead of abbreviations - Associate the field label with the segment shell via aria-labelledby - Convert the presentational calendar icon to an IconButton with an openCalendarLabel translation Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
View your CI Pipeline Execution ↗ for commit 6e5803a ☁️ Nx Cloud last updated this comment at |
|
View your CI Pipeline Execution ↗ for commit 81bac52 ☁️ Nx Cloud last updated this comment at |
|
Move error state to each DatePickerInput so start/end inputs in range mode surface independent messages. Render the error via FormError's `absolute` variant so it sits out of layout flow — the input never changes height, keeping the range-mode arrow aligned and reserving no space when there is no error. The calendar popover still shifts down (y=0) only when open and an error exists, via a boolean `hasError` context signal. Validate typed dates (incomplete, invalid month/day, rollover, disabled dates) through a shared validateSegments util and localizable translation keys. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Wire validateDateRange into the typed-commit path so a range spanning a disabled date shows an error instead of silently resetting; dedupe its span check onto rangeContainsDisabled. Also clean up pre-existing lint. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
aresnik11
marked this pull request as ready for review
August 5, 2026 17:28
Contributor
|
🚀 Styleguide deploy preview ready! Preview URL: https://6a73739e4582b356973dfdb6--gamut-preview.netlify.app |
Collaborator
|
📬 Published Alpha Packages:
|
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.
Overview
Adds per-input validation error messages to
DatePicker:DatePickerInputmanages its own error, so range mode shows independent messages for the start and end inputs. Typed dates are validated on change and blur; invalid input stays visible until corrected.FormError'sabsolutevariant so the input never changes height: the range-mode arrow stays aligned and no space is reserved when there's no error.hasErrorcontext flag); closed-state spacing is unchanged.DatePickerTranslationskeys for each error message, with English defaults.Also adds some calendar/input accessibility refinements:
openCalendarLabeltranslationThere are definitely some bugs so let me know what you find! Also lmk what the error messages should be and if we want any more generic.
PR Checklist
Testing Instructions
Single mode
2/30/2024and blur → shows "February does not have 30 days".2/28/2024→ error clears and the date commits.disableDateprop, type a disabled date → shows "This date is not available".Range mode
2/30/2024→ error appears under the start input only.Calendar + spacing
Accessibility
role="alert"region; start/end errors announce independently.aria-invalidtoggles on each input as its error state changes.PR Links and Envs