Skip to content

[scheduler] Fix aria-labelledby on events referencing non-existent header IDs#22778

Merged
rita-codes merged 2 commits into
mui:masterfrom
rita-codes:22756-scheduler-aria-labelledby-on-events-references-non-existent-header-ids-missing-schedulerid-prefix
Jun 12, 2026
Merged

[scheduler] Fix aria-labelledby on events referencing non-existent header IDs#22778
rita-codes merged 2 commits into
mui:masterfrom
rita-codes:22756-scheduler-aria-labelledby-on-events-references-non-existent-header-ids-missing-schedulerid-prefix

Conversation

@rita-codes

@rita-codes rita-codes commented Jun 11, 2026

Copy link
Copy Markdown
Member

Closes #22756

Summary

Event items in the month "+N more" popover and the Agenda view referenced a header id in their aria-labelledby that didn't exist in the DOM: the real header IDs carry a ${schedulerId}- prefix that the value passed to EventItem omitted. 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 had schedulerId in scope):

  • MoreEventsPopover.tsx${schedulerId}-PopoverHeader-${day.key}
  • AgendaView.tsx (the EventItem call) → ${schedulerId}-DayHeaderCell-${date.key}

Regression tests

Added one test per affected surface, each asserting that every token in an event's aria-labelledby resolves to an existing element in the DOM:

  • MonthView.test.tsx — events inside the "+N more" popover
  • AgendaView.test.tsx — events in the agenda list

Both tests fail without the fix (the unprefixed PopoverHeader-… / DayHeaderCell-… token resolves to null) and pass with it.

Audit

I checked every other aria-labelledby in 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).

…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]>
@rita-codes
rita-codes requested a review from noraleonte June 11, 2026 16:09
@rita-codes rita-codes self-assigned this Jun 11, 2026
@rita-codes rita-codes added accessibility a11y type: enhancement It’s an improvement, but we can’t make up our mind whether it's a bug fix or a new feature. scope: scheduler Changes related to the scheduler. labels Jun 11, 2026
@rita-codes rita-codes changed the title [scheduler] Fix aria-labelledby on events referencing non-existent header IDs [scheduler] Fix aria-labelledby on events referencing non-existent header IDs Jun 11, 2026
…references-non-existent-header-ids-missing-schedulerid-prefix
@code-infra-dashboard

Copy link
Copy Markdown

Deploy preview

https://deploy-preview-22778--material-ui-x.netlify.app/

Bundle size

Bundle Parsed size Gzip size
@mui/x-data-grid 0B(0.00%) 0B(0.00%)
@mui/x-data-grid-pro 0B(0.00%) 0B(0.00%)
@mui/x-data-grid-premium 0B(0.00%) 0B(0.00%)
@mui/x-charts 0B(0.00%) 0B(0.00%)
@mui/x-charts-pro 0B(0.00%) 0B(0.00%)
@mui/x-charts-premium 0B(0.00%) 0B(0.00%)
@mui/x-date-pickers 0B(0.00%) 0B(0.00%)
@mui/x-date-pickers-pro 0B(0.00%) 0B(0.00%)
@mui/x-tree-view 0B(0.00%) 0B(0.00%)
@mui/x-tree-view-pro 0B(0.00%) 0B(0.00%)
@mui/x-license 0B(0.00%) 0B(0.00%)

Details of bundle changes


Check out the code infra dashboard for more information about this PR.

@noraleonte noraleonte left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙏

@rita-codes
rita-codes merged commit c83ce63 into mui:master Jun 12, 2026
21 checks passed
mbrookes pushed a commit to mbrookes/mui-x that referenced this pull request Jun 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

accessibility a11y scope: scheduler Changes related to the scheduler. type: enhancement It’s an improvement, but we can’t make up our mind whether it's a bug fix or a new feature.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[scheduler] aria-labelledby on events references non-existent header IDs (missing schedulerId prefix)

2 participants