Repository navigation
[ReviewEntriesTable] Fix arrow keys in cell dialogs - #4403
Conversation
Key events from dialogs opened in a table cell bubble through the React portal to the cell, where Material React Table's keyboard navigation calls preventDefault on arrow, Home/End, and PageUp/PageDown keys. That kept the cursor from moving in the Edit dialog's text fields. Stop propagation at the cell for key events whose target is outside the cell's DOM, which MRT honors by skipping its shortcuts. Keyboard navigation between cells is unaffected. Fixes #4400 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #4403 +/- ##
==========================================
- Coverage 76.26% 67.16% -9.11%
==========================================
Files 305 248 -57
Lines 11452 6319 -5133
Branches 1409 794 -615
==========================================
- Hits 8734 4244 -4490
+ Misses 2324 1814 -510
+ Partials 394 261 -133
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 44 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Stopping propagation at the cell also kept key events from reaching window listeners, so arrow keys no longer navigated the semantic domain tree opened from the sense editor. Turning off MRT's keyboard shortcuts removes the conflict with any content rendered from a cell, at the cost of arrow-key navigation between table cells. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jasonleenaylor
left a comment
There was a problem hiding this comment.
LGTM
This review was assisted by Claude Opus 5.5.
Fixes #4400
Summary
Key events from a cell's dialog bubble (via React portal) to the table cell, where MRT's keyboard navigation
preventDefaults arrow/Home/End/PageUp/PageDown.useMaterialReactTable({ + enableKeyboardShortcuts: false,Stopping propagation at the cell instead would also block window keydown listeners, which the semantic domain tree (opened from the sense editor) uses for arrow navigation.
Evidence
keyDown(ArrowLeft)in an Edit dialog text field is default-preventedAfter: not default-prevented;
keyDown(ArrowRight)in the dialog reaches window listenersMerge Danger
Door: two-way
Blast Radius: small
Loses arrow-key navigation between Review Entries table cells (and cell
tabIndex).🤖 Generated with Claude Code
This change is