Skip to content

[scheduler] Follow the APG grid pattern for keyboard navigation in the Event Calendar - #24338

Merged
rita-codes merged 43 commits into
mui:masterfrom
rita-codes:scheduler-apg-grid-keyboard
Dec 4, 2026
Merged

rita-codes merged 43 commits into
mui:masterfrom
rita-codes:scheduler-apg-grid-keyboard

Conversation

@rita-codes

@rita-codes rita-codes commented Nov 26, 2026 •

Copy link
Copy Markdown
Member

Closes #24246

The Event Calendar grid followed the Google Calendar model: every cell, header and time column was a tab stop (more than 35 in the month view), and Tab went through the events of each cell. Since the grid exposes role="grid", this PR moves it to the APG grid pattern, as agreed in #24246.

Grid (Month, Week and Day views)

  • Single tab stop (roving tabindex): today's cell, or the last focused one. Navigating to another period resets it. The arrow keys move between cells as before.
  • Home and End move to the first and the last cell of the row, and with Ctrl to the first and the last cell of the grid.
  • Page Up and Page Down move to the previous and the next month, week or day, depending on the view. Focus stays on the same day of the month in the Month view, and on the same cell in the Week and Day views.
  • Enter or F2 move into a cell, in every view. Inside the cell, the arrow keys and Tab / Shift+Tab move between its items and wrap around: day number button → events → "+N more". Escape or F2 move back to the cell. On a cell without items, Enter does nothing.
  • Multi-day events can be reached from every day they cover, not only from the cell they start in.
  • The day number button of the month view can now be reached with the keyboard (it was tabIndex={-1} and unreachable).
  • C creates an event in the focused cell. Enter no longer does, since it now moves into the cell.

Accessible names and announcements

  • Cells: every view uses the same name, with the date in the order of the locale and the number of events, for example "Wednesday, July 2, has 2 events" (new gridCellAriaLabel locale key).
  • Grids: they are named after the dates they display, for example "July 2025, events calendar" (new calendarGridAriaLabel locale key), so they can be told apart from the mini calendar.
  • Rows: they are named too ("Days", "Week 27", "All-day and multi-day events", "Timed events"), so a screen reader no longer reads every cell of the row as its name (new gridHeaderRowLabel and timeGridLabel locale keys).
  • View and date changes: a role="status" region announces the view and its dates when they change, for example "Day view, Monday, July 7, 2025" (new visibleRangeAnnouncement locale key). It replaces the aria-live on the toolbar label, which stayed silent when moving inside the same month.
  • New event dialog: it is named after the day, for example "New event, Wednesday, July 2" (new newEventDialogLabel locale key). The drawer of the compact views is now a named dialog too.

Events

  • Space opens a focused event, like Enter (it used to open the context menu).
  • Shift+F10 or the Menu key open its context menu, anchored to the event.
  • On a touch device with a keyboard, Tab moves between an armed event and its toolbar, and the arrow keys, Home and End move between the toolbar buttons.

This applies to every surface using the event context menu (Calendar views, Agenda, "+N more" popover, Event Timeline).

"+N more" popover

  • Opening it moves focus to its first event (it used to stay on the popover itself).
  • The arrow keys move between its events and wrap around, like inside a cell. Tab keeps working.

Not in this PR

Docs

The keyboard and live region sections of the accessibility page are updated.

Testing

Checked with NVDA 2026.3.1 and JAWS 2027 + Chrome on Windows, and with VoiceOver + Chrome on macOS.

@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 Nov 26, 2026
@rita-codes rita-codes self-assigned this Nov 26, 2026
@code-infra-dashboard

code-infra-dashboard Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

Deploy preview

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-scheduler 🔺+7.76KB(+1.95%) 🔺+2.92KB(+2.56%)
@mui/x-scheduler-premium 🔺+7.76KB(+1.50%) 🔺+2.91KB(+1.96%)
@mui/x-chat 0B(0.00%) 0B(0.00%)
@mui/x-license 0B(0.00%) 0B(0.00%)

Details of bundle changes

Performance

No regressions in 38 benchmarks · precise to ±13.2% (±62.1% at worst) · ran 9m 28s · details


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

rita-codes and others added 5 commits November 26, 2026 19:00
…the time grid, stable tab stop

- Let Escape disarm an armed event before it moves focus back to the cell.
- Keep the scrollers of the Week and Day views out of the Tab sequence.
- Only reset the tab stop of the month view when its days change, and use the first visible day of the month when the 1st is hidden.
- Keep the menu anchored to the event when the browser fires contextmenu for the key that opened it, without a flag left behind.
- Leave the number of events out of the cell names while loading.
- Accept the key in the position of C on non-Latin layouts, and ignore IME composition.
- Share the arrow key handling of the cell items with the "+N more" popover.
- Fix stale comments and docs, and add the missing tests.
The focused cell state only told each cell to focus itself from an effect. The root now focuses the cell directly, and focusing a cell makes it the tab stop.

@flaviendelangle flaviendelangle left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

PR review

Two merge-blocking keyboard regressions. Both reproduce on the PR and pass against the pre-PR production code. Existing targeted suites passed: 177 tests, one skipped. Verification used jsdom.

Bugs (2)

1. 🔴 Tab wrapping prevents reaching the armed event toolbar

Location: CalendarGridRoot.tsx:221

if (event.key === 'Tab') {
  offset = event.shiftKey ? -1 : 1;
}

On a coarse-pointer device, activating an event arms its toolbar while leaving focus on the event. The new Tab handling cycles through the cell’s items indefinitely, preventing the usual keyboard path to the portaled Edit/Delete buttons. Escape dismisses the toolbar. F2 provides an indirect workaround by exiting the cell while keeping it armed.

Failure scenario: On a touch-capable device with a keyboard, focus an event, press Enter, then Tab. Focus keeps cycling inside the cell instead of reaching Edit.

Fix: Move focus into the toolbar after keyboard activation, or allow Tab to reach its controls while armed. Add a regression covering activation through to the Edit action.

2. 🔴 The creation shortcut consumes text input in custom event content

Location: CalendarGridRoot.tsx:193

if (isCreateEventKey(event)) {
  const createEvent = cellsRef.current.get(cell)?.createEvent;
  if (createEvent) {
    event.preventDefault();
    createEvent(event.nativeEvent);
  }
}

The shortcut uses enteredCellRef for any descendant target. After focusing an event, moving into a nested input leaves that reference set. Typing c therefore prevents text entry and triggers event creation. Previously, keyboard creation required the cell itself to be the event target.

Failure scenario: Render an input inside CalendarGrid.DayEvent, focus the event, then its input, and type cat. The input receives at.

Fix: Exclude inputs, textareas, and editable descendants before processing the creation shortcut. Add a regression verifying that typing preserves the text without creating an event.

Tests (0)

No findings.

Simplifications (0)

No findings.

Docs (0)

No findings.

Verdict

Request changes - preserve keyboard access to the armed toolbar and text entry in custom event content.


🤖 Review generated with Codex

@rita-codes

Copy link
Copy Markdown
Member Author

Thanks! Both fixed:

  1. Tab from an armed event now moves into its toolbar, which also follows the APG toolbar pattern: the arrow keys, Home and End move between its buttons, Tab goes back to the event, and Escape disarms and keeps focus on the event. This works for both the anchored toolbar and the one docked in the compact views. Closing the dialog opened from Edit now also brings focus back to the event. 12fe731
  2. C only creates an event when focus is on the cell or on one of its items, not on an element inside an item. cffd1b6

@flaviendelangle

Copy link
Copy Markdown
Member

PR review

One merge-blocking keyboard regression remains in the armed toolbar when opened from the "+N more" popover. The earlier grid-toolbar and nested-input fixes work in their covered scenarios. Existing targeted suites passed: 351 tests in Chromium with 3 skipped, and 308 in jsdom with 1 skipped.

Bugs (1)

1. 🔴 Keep toolbar focus inside the more-events popover's focus scope

Location: EventToolbar.tsx:133–135

if (target === anchor && !event.shiftKey && tabStop != null) {
  event.preventDefault();
  tabStop.focus();
}

An event in the "+N more" popover can also arm this toolbar on a coarse-pointer device. The popover keeps its MUI modal focus trap active, while AnchoredEventToolbar portals the toolbar outside that trap. Consequently, tabStop.focus() immediately sends focus back to the popover paper. Since this handler already prevented the default Tab action, focus reaches neither the toolbar nor the next event.

I reproduced this in jsdom and Chromium. A Chromium check requiring focus to remain on an actionable item after Tab fails on this head and passes when only EventToolbar.tsx is restored to its pre-PR implementation.

Failure scenario: On a touch-capable device with a keyboard, open a month cell's "+N more" popover, focus an event, press Enter to arm it, then Tab. Focus lands on the popover paper instead of Edit, interrupting keyboard navigation through the events.

Fix: Coordinate the armed toolbar with the popover's focus trap, for example by rendering the toolbar within its focus scope or suspending enforcement while that toolbar owns focus. Add a regression covering keyboard activation from the more-events popover through Tab to Edit.

Tests (0)

No findings.

Simplifications (0)

No findings.

Docs (0)

No findings.

Verdict

Request changes - the new Tab routing loses actionable focus when an event is armed inside the more-events popover.


🤖 Review generated with Codex

🤖 Comment generated with Codex

@rita-codes

Copy link
Copy Markdown
Member Author

@flaviendelangle Reproduced and fixed in 9b7c6d0: the popover no longer enforces focus while an event is armed, so Tab reaches the toolbar. Added a regression test covering Enter → Tab → Edit → Tab back from the more-events popover.

@flaviendelangle flaviendelangle left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

PR review

Bugs (7)

1. 🔴 Time-only grids lose their tab stop with default root props

Location: CalendarGridRoot.tsx:86

rowType: rowTypes.find((rowType) => rowType !== 'header') ?? rowTypes[0],

The default rowTypes includes day-grid, so the fallback selects that row even when only time columns are rendered. Every actual column receives tabIndex={-1}. Existing TimeColumn and TimeEvent test wrappers use this composition.

Failure scenario: Render <CalendarGrid.Root> containing a time column without overriding rowTypes. Tab skips the entire grid. Reproduced locally.

Fix: Choose a fallback from registered cells and ensure the active tab stop still exists after cells are removed.

2. 🔴 Overflow can redirect focus to the wrong multi-day event segment

Location: calendar-grid-items.ts:42

Array.from(row.querySelectorAll<HTMLElement>(selector)).find(
  (candidate) =>
    candidate.getAttribute(CALENDAR_GRID_ITEM_ATTRIBUTE) === key && !isHidden(candidate),
)

One occurrence can have multiple visible segments in the same week after an overflow day interrupts its bar. Selecting the first visible occurrence key ignores which segment covers the entered cell.

Failure scenario: An event appears Monday, overflows Tuesday, and resurfaces Wednesday through Friday. Entering it from Thursday focuses Monday’s disconnected segment. Its editing surface also anchors there. Reproduced with the real MonthView.

Fix: Resolve the visible segment covering the entered day, rather than the first matching occurrence in the row.

3. 🔴 Replacing a cell’s render element leaves its registration stale

Location: useCalendarGridCellKeyboard.ts:34

const cell = cellRef.current;
// ...
}, [cellRef, coordinates, canCreateEvent, stableCreateEvent, registerCell]);

The effect tracks the stable ref object, not the DOM node it contains. Changing the supported render element can replace that node without changing any dependency. The registry retains the detached element.

Failure scenario: Change a cell’s render element while keeping its coordinates. C stops creating events on the replacement, and navigation from neighboring cells targets the detached node. Reproduced locally.

Fix: Register and unregister through a callback ref or a reactive DOM-node value.

4. 🔴 Root keyboard handlers run before consumer cancellation

Location: CalendarGridRoot.tsx:255

props: [
  elementProps,
  { /* ... */ onKeyDown: handleKeyDown },
],

Base UI merges event handlers in right-to-left order. The built-in handler therefore creates an event or changes focus before the consumer’s handler runs.

Failure scenario: Supply onKeyDown on the root to prevent the C shortcut. Pressing C still creates an event. Reproduced locally; reversing the merge order makes the reproduction pass.

Fix: Put elementProps last, consistent with the cell components.

5. 🔴 Event context menus ignore keyboard cancellation

Location: EventContextMenuContext.tsx:194

childProps.onKeyDown?.(event);
if (!isContextMenuKey(event) || !menuContext || isCoarsePointer()) {

The wrapper invokes the child’s handler but opens its menu even when that handler cancels the shortcut.

Failure scenario: An event or its custom content handles Shift+F10 and calls preventDefault(). The scheduler still opens its context menu and takes focus. Reproduced locally; checking cancellation makes the reproduction pass.

Fix: Honor defaultPrevented and the applicable Base UI cancellation flag before opening the menu.

6. 🔴 Toolbar navigation misses events inside shadow roots

Location: EventToolbar.tsx:123

const target = event.target as HTMLElement;
// ...
if (target === anchor && !event.shiftKey && tabStop != null) {

This document listener receives the shadow host as event.target, so the anchor comparison fails.

Failure scenario: Inside a shadow root, arm an event and press Tab. Focus follows the grid’s item navigation instead of entering the toolbar.

Fix: Resolve the original target through event.composedPath() or the shared shadow DOM helper. The earlier integration reproduction fails on the PR and passes with this substitution.

7. 🟠 Multi-day keyboard navigation performs quadratic DOM scans

Location: calendar-grid-items.ts:42

Array.from(row.querySelectorAll<HTMLElement>(selector)).find(...)

Every hidden copy queries and allocates the entire row again. Successful keyboard movement calls this helper before focus and again during the focus event. Week view has no event-count cap.

Failure scenario: Navigating a week containing hundreds of spanning events stalls. In Chromium, 400 week-long events took a median 41.8 ms per helper call, approximately 84 ms of lookup work per focus move.

Fix: Index visible segments once per invocation and use a Set for deduplication, preserving the segment-aware resolution required by finding 2.

Tests (1)

8. 🟠 Cover creation from a multi-day event’s logical cell

Location: MonthView.test.tsx:1896

await user.keyboard('{Enter}{ArrowDown}');
// ...
await user.keyboard('{Escape}');

The multi-day test checks navigation and Escape, while positive C-creation tests focus the cell itself. None protects creation from an item rendered under another day.

Failure scenario: Enter May 6, focus an event physically rendered under May 5, then press C. A regression could create on May 5 or do nothing without failing current tests.

Fix: Extend this scenario to assert through onEventEditingStart that creation starts on May 6.

Simplifications (0)

No findings.

Docs (2)

9. 🟡 Document the armed toolbar’s keyboard behavior

Location: accessibility.md:145

Tab / Shift+Tab | Same as the arrow keys
Escape or F2   | Moves focus back to the cell

Failure scenario: On an armed event, Tab enters the toolbar instead, and Escape first disarms while retaining event focus. Users following this table encounter different behavior.

Fix: Qualify these rows and document toolbar navigation with Left/Right, Home/End, Tab, and Escape.

10. 🟡 Update the time event’s tabindex description

Location: CalendarGridTimeEvent.tsx:151

* Whether the event behaves like a button: `role="button"` and a roving `tabIndex`.

Failure scenario: The JSDoc describes the removed behavior. Interactive events now stay at tabIndex={-1}; their containing cell owns the roving tab stop.

Fix: Describe programmatic access through Enter/F2 on the containing column.

Verdict

Request changes because the additional reproductions confirm failures in keyboard entry, focus placement, cell registration, and handler cancellation.


🤖 Review generated with Codex

@github-actions github-actions Bot added the PR: out-of-date The pull request has merge conflicts and can't be merged. label Dec 1, 2026
@github-actions

github-actions Bot commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@rita-codes

Copy link
Copy Markdown
Member Author

@flaviendelangle All fixed in 1d7a161, with a regression test for each of the three bugs:

  • 1: the target is now the focused day of the month in the month that ends up displayed, so it no longer depends on the month of the focused cell.
  • 2: when that day is hidden or missing, focus goes to the next visible day of the month, or to the last one.
  • 3: the pending focus is no longer dropped on a timer. It is kept until the days change, and it is only applied if focus is still on the origin cell or was lost with it.
  • 4: updated.

I also ran the PR through NVDA 2026.3.1 + Chrome. It found one bug, fixed in 2243e98: the view change made from the view menu was not announced, because the Material UI menu hides the page from assistive technologies while it closes.

@rita-codes rita-codes added type: enhancement It’s an improvement, but we can’t make up our mind whether it's a bug fix or a new feature. and removed type: enhancement It’s an improvement, but we can’t make up our mind whether it's a bug fix or a new feature. labels Dec 2, 2026
@flaviendelangle

Copy link
Copy Markdown
Member

PR review

One merge-blocking keyboard-entry issue remains in dynamic compositions of the exported grid primitives. The previous paging findings and docs correction are addressed, and the paging reproductions now pass in jsdom and Chromium. All 18 changed test files pass in jsdom: 484 tests passed, 9 skipped.

Bugs (1)

1. 🔴 Invalidate the active cell when its row or column disappears

Location: CalendarGridRoot.tsx:95

const validActiveCell =
  activeCell != null && rowTypes.includes(activeCell.rowType) ? activeCell : null;
const tabStop = validActiveCell ?? defaultFocusedCell ?? fallbackTabStop;

The guard checks the row type but retains coordinates for a removed row within that type, or a removed column. Those coordinates override the fallback even though no remaining cell matches them. Every remaining cell then has tabIndex={-1}, making the entire grid unreachable through Tab.

Failure scenario: Render CalendarGrid.Root with rowTypes={['day-grid']}, rowsPerType={{ 'day-grid': 3 }}, and the optional defaultFocusedCell omitted. Focus a cell in row index 2, move focus outside, then remove that row and update rowsPerType to 2. Tab skips the grid. Both props accurately describe the remaining grid. Removing the active last column produces the same result.

This affects compositions using the published @mui/x-scheduler-internals/calendar-grid primitives. The built-in Month, Week, and Day views reset their defaultFocusedCell when dimensions change and avoid this case.

I reproduced both removal cases in jsdom and Chromium. A temporary check that clears active coordinates once their cell is no longer registered makes both cases pass in both environments; the 49 existing grid navigation tests also pass with that check.

Fix: Clear or clamp the active coordinates when their cell disappears, validating row and column existence as well as row type after registration settles. Ensure a surviving cell becomes the tab stop. Extend the existing row-removal regression to cover shrinking the row count within one type and removing the active column.

Tests (0)

No findings.

Simplifications (0)

No findings.

Docs (0)

No findings.

Verdict

Request changes - removing the active row or column can remove keyboard access to an exported grid composition.


🤖 Comment generated with Codex

🤖 Review generated with Codex

flaviendelangle

This comment was marked as duplicate.

@github-actions github-actions Bot added the PR: out-of-date The pull request has merge conflicts and can't be merged. label Dec 3, 2026
@github-actions

github-actions Bot commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

This pull request has conflicts, please resolve those before we can evaluate the pull request.

…d-keyboard

# Conflicts:
#	docs/data/scheduler/localization/data.json
#	packages/x-scheduler/src/locales/koKR.ts
@flaviendelangle

Copy link
Copy Markdown
Member

PR review

Nothing here blocks the merge. The three commits since the last round fix what they target. Three new issues reproduce in jsdom on 9a002f3, and there is one optional simplification. The full x-scheduler* jsdom suite passes on this head (4574 passed, 172 skipped). I didn't run a screen reader.

Bugs (3)

1. 🟠 A Page Up or Page Down that changes nothing still moves focus later

Location: useCalendarGridPageNavigation.ts:78-84

useIsoLayoutEffect(() => {
  const pendingFocus = pendingFocusRef.current;
  pendingFocusRef.current = null;
  // The focus moved somewhere else in the meantime.
  if (pendingFocus == null || !isFocusLostWith(pendingFocus.origin)) {
    return;
  }

Since 1d7a161 removed the timer, the request lives until the days change. If eventDetails.cancel() cancels the change, or a controlled visibleDate ignores it, the request stays in the ref and the next date change from anywhere applies it. isFocusLostWith doesn't stop it when focus is on the document. Focus ends up there after a click on a non-focusable area, and after a click on a toolbar button in Safari, which doesn't focus buttons on click.

Failure scenario: An app cancels navigation past a max date. In the Month view of May 2025, focus May 15 and press Page Down (canceled). Click a non-focusable area outside the grid, then let the app move to August. Focus jumps to August 15. I reproduced it in jsdom with a controlled visibleDate and setProps. Without the canceled Page Down, focus stays on the body.

Fix: Drop the request when focus leaves the origin cell while that cell is still mounted. For example, a focusout listener on origin that checks origin.isConnected in a microtask: an unmount disconnects the cell, a user moving focus doesn't. The delayed controlled update keeps working. Add a test with a canceled Page Down followed by an unrelated date change.

2. 🟡 The tab stop resets without a change of period

Location: DayTimeGrid.tsx:430-433, MonthView.tsx:196-204

const defaultFocusedCell = React.useMemo(
  () => getDefaultFocusedCell([days], 'time-grid', [nowDayNumber]),
  [days, nowDayNumber],
);

CalendarGrid.Root reads a new defaultFocusedCell object as another period and forgets the last focused cell (CalendarGridRoot.tsx:80-85). Two things create a new object while the period stays the same:

  • In the Week view, days is a new array whenever the visible date moves inside the displayed week. MonthView guards against this with startOfMonthDayNumber and tests it ("should keep the tab stop when the visible date changes within the month"). DayTimeGrid has no such guard.
  • In both views, nowDayNumber changes at midnight. The Month view resets even when today isn't displayed.

Failure scenario: In the Week view of May 4-10, focus Thursday, then pick Tuesday of the same week in the mini calendar, or update a controlled visibleDate to it. Tab back into the grid lands on Sunday, not Thursday. At midnight, focus stays on May 20 but it gets tabindex="-1" and May 2 becomes the tab stop. Both reproduce in jsdom. The PR body sets the rule as "today's cell, or the last focused one. Navigating to another period resets it."

Fix: Reset on a change of the displayed period only, for example on firstDayNumber and lastDayNumber, which DayTimeGrid already computes. Today can then update the default without forgetting the last focused cell. A separate reset key on CalendarGrid.Root would make this explicit. Add the in-week and midnight cases to the tests.

3. 🟡 The live region announces the Agenda view when its events change

Location: VisibleRangeAnnouncer.tsx:13-14

const visibleDaysSelector = (state: EventCalendarState) =>
  state.viewDefinition?.visibleDaysSelector(state);

For the Agenda view this is eventCalendarAgendaSelectors.visibleDays. With showEmptyDaysInAgenda: false it keeps only the days that have events, so the announced range changes when an event is created, deleted or moved, when a resource is toggled, or when a data source loads. The reverse happens too: when no event falls in the horizon, days is empty, text is null, and switching to the Agenda view isn't announced.

Failure scenario: <EventCalendar defaultView="agenda" defaultPreferences={{ showEmptyDaysInAgenda: false }} /> with events on May 2, 5 and 9. Remove the May 9 event and the status region says "Agenda view, May 2 – 5, 2025", though nobody navigated. Reproduced in jsdom.

Fix: For the Agenda view, announce eventCalendarAgendaSelectors.baseVisibleDays, the range Previous and Next move through. Add a test that removes an event with empty days hidden.

Tests (0)

No findings.

Simplifications (1)

4. 🟡 Share the hidden date and event count label

Location: MonthViewCell.tsx:256-263, DayGridCell.tsx:116-123, TimeGridColumn.tsx:136-143

<span
  id={labelId}
  // The events are unknown while loading.
  aria-label={
    isLoading ? dateLabel : localeText.gridCellAriaLabel(dateLabel, day.withPosition.length)
  }
  hidden
/>

The three cells repeat the same useId, the dateLocale and isLoading subscriptions, formatWeekdayMonthAndDayOfMonth, the loading rule and this span. Only the event count differs.

Failure scenario: A change to the label, such as announcing the loading state, has to land in three files, and missing one makes the Month and Week views name their cells differently.

Fix: Move it into one small component, for example <GridCellLabel id={labelId} day={day.plainDate} eventCount={count} />, which owns the subscriptions and the loading rule.

Docs (0)

No findings.

Verdict

Approve after nits - nothing blocks the merge, and the leftover Page Down focus request is the one worth fixing first.


🤖 Review generated with Claude Code

🤖 Comment generated with Claude

@flaviendelangle

Copy link
Copy Markdown
Member

Feel free to merge after this review
We can find some follow ups in wider accessibility audit of the component, but it's a very strong starting point 👌

@github-actions github-actions Bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged. label Dec 3, 2026
@rita-codes

Copy link
Copy Markdown
Member Author

@flaviendelangle Thanks for the reviews! Everything is addressed:

  • Active cell removed (previous round): fixed in 9a002f3. The root clears the active cell when no registered cell has its coordinates, so the tab stop falls back to defaultFocusedCell or the first cell.
  • 1: the pending focus is dropped when focus leaves the origin cell while that cell is still rendered.
  • 2: CalendarGrid.Root no longer resets the tab stop on a new defaultFocusedCell object. It has a tabStopResetKey prop, which the views set to their first and last displayed day.
  • 3: the Agenda view announces baseVisibleDays.
  • 4: moved to a GridCellLabel component.

Each bug has its regression test.

@github-actions github-actions Bot added the PR: out-of-date The pull request has merge conflicts and can't be merged. label Dec 4, 2026
@github-actions

github-actions Bot commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

This pull request has conflicts, please resolve those before we can evaluate the pull request.

…d-keyboard

# Conflicts:
#	docs/data/scheduler/localization/data.json
#	packages/x-scheduler-internals/src/calendar-grid/day-cell/CalendarGridDayCell.tsx
#	packages/x-scheduler/src/locales/arSD.ts
#	packages/x-scheduler/src/locales/beBY.ts
#	packages/x-scheduler/src/locales/bgBG.ts
#	packages/x-scheduler/src/locales/bnBD.ts
#	packages/x-scheduler/src/locales/caES.ts
#	packages/x-scheduler/src/locales/csCZ.ts
#	packages/x-scheduler/src/locales/daDK.ts
#	packages/x-scheduler/src/locales/deDE.ts
#	packages/x-scheduler/src/locales/elGR.ts
#	packages/x-scheduler/src/locales/esES.ts
#	packages/x-scheduler/src/locales/faIR.ts
#	packages/x-scheduler/src/locales/fiFI.ts
#	packages/x-scheduler/src/locales/frFR.ts
#	packages/x-scheduler/src/locales/heIL.ts
#	packages/x-scheduler/src/locales/hrHR.ts
#	packages/x-scheduler/src/locales/huHU.ts
#	packages/x-scheduler/src/locales/hyAM.ts
#	packages/x-scheduler/src/locales/idID.ts
#	packages/x-scheduler/src/locales/isIS.ts
#	packages/x-scheduler/src/locales/itIT.ts
#	packages/x-scheduler/src/locales/jaJP.ts
#	packages/x-scheduler/src/locales/koKR.ts
#	packages/x-scheduler/src/locales/nbNO.ts
#	packages/x-scheduler/src/locales/nlNL.ts
#	packages/x-scheduler/src/locales/nnNO.ts
#	packages/x-scheduler/src/locales/plPL.ts
#	packages/x-scheduler/src/locales/ptBR.ts
#	packages/x-scheduler/src/locales/ptPT.ts
#	packages/x-scheduler/src/locales/roRO.ts
#	packages/x-scheduler/src/locales/ruRU.ts
#	packages/x-scheduler/src/locales/skSK.ts
#	packages/x-scheduler/src/locales/svSE.ts
#	packages/x-scheduler/src/locales/thTH.ts
#	packages/x-scheduler/src/locales/trTR.ts
#	packages/x-scheduler/src/locales/ukUA.ts
#	packages/x-scheduler/src/locales/urPK.ts
#	packages/x-scheduler/src/locales/viVN.ts
#	packages/x-scheduler/src/locales/zhCN.ts
#	packages/x-scheduler/src/locales/zhHK.ts
#	packages/x-scheduler/src/locales/zhTW.ts
#	packages/x-scheduler/src/month-view/month-view-row/MonthViewCell.tsx
@github-actions github-actions Bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged. label Dec 4, 2026
@rita-codes
rita-codes merged commit c0ca1f9 into mui:master Dec 4, 2026
22 checks passed
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] Follow the APG grid pattern for keyboard navigation in the event grid calendar

2 participants