-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[data grid] Custom Header Keyboard Navigation #12616
Comments
Hey @mogrady88, Could you please provide a minimal reproduction test case with the latest version. This would help a lot 👷. A live example would be perfect. You can find a examples and guides on how to find templates in our docs with which you can provide examples for your specific use-case: Support - Bug reproduction. Thank you! 🙇🏼 |
Hey Michel, you are right. The issue turned out to be my own. We're trying to implement a custom checkAll header with some additional functionality and it looks like there are some limitations around keyboard events. This source code reads like you short circuit keyboard events from custom Our current solution is to define a column with a Do you have any advice on how to drill keyboard events to a |
Well ... for the keyboard navigation to work you would need to handle key strokes inside the rendered header on your own. I did test it with a simple button and pressing Screen.Recording.2024-04-03.at.12.11.57.movThe underlying problem why the keyboard navigation is no longer working is that the button receives focus and traps it. The events for arrows need to be bubbled to the parent container, so that they can act upon it. |
The issue has been inactive for 7 days and has been automatically closed. |
Steps to reproduce
Link to live example: (required) https://mui.com/x/react-data-grid/column-header/#custom-header-renderer
Steps:
Custom Header Renderer
Current behavior
I have a custom checkbox renderer made up of:
It is housed in a
ColDef > renderHeader
Ive been trying everything I can to get this component to both respect the keyboard navigation (Right/Left arrow keys) as well as the keyboard events for the buttons and I cannot get it to work.
I thought it was an implementation issue on my part but then I discovered that this same thing happens in your docs in the
Custom Header Renderer
demo if you duplicate the columns.Expected behavior
A custom header using
headerRenderer
should work by allowing for keyboard navigation across it unless you somehow focus into that cell. It should not get "stuck" in that cell when you're using Right/Left arrows to traverse the tableContext
Im trying to accomplish rendering a custom component in my checkboxSelection DataGrid. Keyboard events work for my custom
TableHeaderCell
but when it's thrown into the DataGrid I dont get any eventing coming through and the Right/Left arrows no longer work.My custom component receives focus and I can tab through it but the
Enter
key doesnt fire any event against the custom componentYour environment
npx @mui/envinfo
Search keywords: data grid custom header keyboard navigation renderHeader checkbox
The text was updated successfully, but these errors were encountered: