[calendar] Preserve keyboard focus through viewport remounts#4462
[calendar] Preserve keyboard focus through viewport remounts#4462atomiks wants to merge 11 commits intomui:masterfrom
Conversation
Codex Review (GPT-5.4)This remains a 1. Remaining Bugs / Issues (None)2. Root Cause & Patch AssessmentThe core fix is still in the right layer. The latest follow-up also closes the deferred controlled-update gap without adding much extra machinery. The next-tick timeout is gone, the handoff now survives asynchronous 3. Pattern Consistency Assessment
4. Edge Cases Worth Noting
5. Test Coverage AssessmentThe regression coverage is in good shape now and it is validating the right failure modes. Meaningful validation I checked on the rebased branch:
The most important addition is the deferred controlled viewport regression in 6. Previous Review Issues Status
Merge Confidence ScoreOverall merge confidence is 4/5. I do not see a remaining branch-relevant bug in the current calendar fix, and the regression coverage now covers the deferred controlled path that was previously missing. I would be comfortable merging this version. |
commit: |
Bundle size report
Check out the code infra dashboard for more information about this PR. |
✅ Deploy Preview for base-ui ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
packages/react/src/calendar/day-grid-body/CalendarDayGridBody.keyboard.test.tsx
Outdated
Show resolved
Hide resolved
packages/react/src/calendar/day-grid-body/CalendarDayGridBody.keyboard.test.tsx
Show resolved
Hide resolved
packages/react/src/calendar/day-grid-body/CalendarDayGridBody.keyboard.test.tsx
Outdated
Show resolved
Hide resolved
4528c87 to
cce7159
Compare
This preserves keyboard focus when
Calendar.Viewportremounts month content to keep interrupted transitions restartable.The fix moves the pending cross-month focus target into shared calendar state so the newly mounted day grid can complete the handoff after its item map is rebuilt. The docs Motion example can keep its original structure, and the wording update to Motion remains.
Changes
Calendar.Viewportremounts in the calendar source.PageUp/PageDownand arrow-key month wrapping.