[scheduler] Fix aria-labelledby on events referencing non-existent header IDs#22778
Merged
Conversation
…ader IDs
Add the missing ${schedulerId}- prefix to the header id passed to EventItem
in the "+N more" popover and the Agenda view, so each event's accessible name
correctly references its day/date header.
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
aria-labelledby on events referencing non-existent header IDs
…references-non-existent-header-ids-missing-schedulerid-prefix
Deploy previewBundle size
Check out the code infra dashboard for more information about this PR. |
mbrookes
pushed a commit
to mbrookes/mui-x
that referenced
this pull request
Jun 27, 2026
…header IDs (mui#22778) Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
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.
Closes #22756
Summary
Event items in the month "+N more" popover and the Agenda view referenced a header
idin theiraria-labelledbythat didn't exist in the DOM: the real header IDs carry a${schedulerId}-prefix that the value passed toEventItemomitted. As a result the date/day part of each event's accessible name was a dangling reference, so screen readers didn't announce which day an event belonged to.Changes
Added the missing
${schedulerId}-prefix in both call sites (both already hadschedulerIdin scope):MoreEventsPopover.tsx→${schedulerId}-PopoverHeader-${day.key}AgendaView.tsx(theEventItemcall) →${schedulerId}-DayHeaderCell-${date.key}Regression tests
Added one test per affected surface, each asserting that every token in an event's
aria-labelledbyresolves to an existing element in the DOM:MonthView.test.tsx— events inside the "+N more" popoverAgendaView.test.tsx— events in the agenda listBoth tests fail without the fix (the unprefixed
PopoverHeader-…/DayHeaderCell-…token resolves tonull) and pass with it.Audit
I checked every other
aria-labelledbyin the scheduler that points at a header. No other occurrences of this bug: the rest keep both sides in sync by sharing the same variable (weekNumberId), the same helper (getCalendarGridHeaderCellId), or an identical prefixed template (all-day header cell, timeline title cell).