fix(material/datepicker): replace aria-pressed with aria-selected on …#33235
Open
manichandra wants to merge 1 commit intoangular:mainfrom
Open
fix(material/datepicker): replace aria-pressed with aria-selected on …#33235manichandra wants to merge 1 commit intoangular:mainfrom
manichandra wants to merge 1 commit intoangular:mainfrom
Conversation
…calendar cells Date selection buttons use aria-pressed to indicate selection state. This is semantically incorrect: aria-pressed applies to toggle buttons where the user can press again to deselect. Calendar dates cannot be deselected by re-clicking, so the correct attribute per WAI-ARIA 1.2 and WCAG 2.1 SC 4.1.2 (Name, Role, Value) is aria-selected. - calendar-body.html: bind [attr.aria-selected] instead of [attr.aria-pressed] - calendar-cell-harness.ts: isSelected() reads aria-selected attribute - calendar-body.spec.ts: update test name and assertions to match Fixes angular#30190
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.
Description
Calendar date cells in
mat-calendar-bodybind[attr.aria-pressed]toindicate selection state. This is incorrect:
aria-pressedis semantically for toggle buttons — it implies the usercan press again to deselect
"selected", misleading users about the actual interaction
Per WAI-ARIA 1.2 §6.6.4 and WCAG 2.1 SC 4.1.2 (Name, Role, Value),
aria-selectedis the correct attribute for selection state within agrid widget.
Fixes #30190
Changes
calendar-body.html:[attr.aria-pressed]→[attr.aria-selected]; updated inline commentcalendar-cell-harness.ts:isSelected()readsaria-selectedcalendar-body.spec.ts: test name and assertions updated to matchTesting
Existing test updated — no behavior changes, only the ARIA attribute name.