You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[data grid] Changing Tab Key for Navigation . #9415
In Datagrid , I can go to the next focus input with TAB key.
However , I want to customize the TAB key with the Enter Key
Examples 🌈
No response
Motivation 🔦
No response
Order ID 💳 (optional)
No response
Reacted by Rom Grk, sd-danhill, shivghai, mtech-jvaarakangas, Johannes Vääräkangas, Jere Rahikainen, Markku Pitkänen, blakewats, Blake Kelley and Bruce9000
There isn't an easy way to do it, we hardcode the Tab key in a few places. You could try to add capture event listeners to catch those, but it would be quite messy.
I'll assume you're referring to navigate between the inputs from a row in edit mode, am I correct? That's the only scenario where we allow Tab. If yes, then you can use the onCellKeyDown prop to intercepts all Tab events and cancel their default behavior. Additionally, you'll have to use this prop again, but intercepting Enter events, and update manually which cell should gain focus. We already do this internally for Tab so there's something you can reuse in
Thanks ! I will try to use the same logic used for Tab events on Enter Key .
If you accept contributions for making the Tab customizable , I'd be happy to raise a PR.
If not , please keep this issue open for now.
Status update after triage: this is still not implemented. The grid hardcodes the Tab key for field navigation in row edit mode, and no key-remapping API exists.
Two related notes:
The workaround from this comment still works: intercept the keys with onCellKeyDown, set event.defaultMuiPrevented = true, and move the focus manually.
We discussed this internally. Since this is open for quite some time now and only gained 10 upvotes we will not implement a key re-mapping feature. Instead we recommend using the approach shared here for any customization regarding key-handling in cells.
Activity
romgrk commentedon Jun 21, 2023
There isn't an easy way to do it, we hardcode the
Tabkey in a few places. You could try to add capture event listeners to catch those, but it would be quite messy.Safouene1 commentedon Jun 22, 2023
Are contributions for making it a custom event key (but the default is Tab) are needed or if there's any Ticket about it ? .
I'd be happy to help.
m4theushw commentedon Jun 22, 2023
I'll assume you're referring to navigate between the inputs from a row in edit mode, am I correct? That's the only scenario where we allow Tab. If yes, then you can use the
onCellKeyDownprop to intercepts all Tab events and cancel their default behavior. Additionally, you'll have to use this prop again, but intercepting Enter events, and update manually which cell should gain focus. We already do this internally for Tab so there's something you can reuse inmui-x/packages/grid/x-data-grid/src/hooks/features/editing/useGridRowEditing.ts
Lines 192 to 218 in 725d2cb
Since Enter is also used to save the row, you need to also cancel the default behavior and provide an alternative to save the row, e.g. a save button.
Safouene1 commentedon Jun 22, 2023
Thanks ! I will try to use the same logic used for
Tabevents onEnter Key.If you accept contributions for making the
Tabcustomizable , I'd be happy to raise a PR.If not , please keep this issue open for now.
m4theushw commentedon Jun 22, 2023
If other users manifest interest in having an option to customize Tab, then we can accept a contribution. I'll keep this issue open.
[-]Changing Tab Key for Navigation . [/-][+][data grid] Changing Tab Key for Navigation . [/+]michelengelen commentedon Sep 2, 2026
Status update after triage: this is still not implemented. The grid hardcodes the Tab key for field navigation in row edit mode, and no key-remapping API exists.
Two related notes:
onCellKeyDown, setevent.defaultMuiPrevented = true, and move the focus manually.tabNavigationprop ([DataGrid] AddtabNavigationprop to control tab navigation in the grid #20286) controls Tab navigation across cells and headers. It does not remap keys, so it solves a different problem.The issue stays open and waits for more upvotes.
michelengelen commentedon Oct 30, 2026
We discussed this internally. Since this is open for quite some time now and only gained 10 upvotes we will not implement a key re-mapping feature. Instead we recommend using the approach shared here for any customization regarding key-handling in cells.