-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[datagrid] Toolbar panels don't restore focus after closing with Escape
#10241
Comments
Thanks for raising the issue. Seems like a similar problem exists with all the menus that open up by clicking on the Toolbar menu buttons and actions menu. Honestly I am not sure what should be the behavior when clicking on the button and pressing escape key or closing the menu. Focus shifting to the button could certainly be one direction to proceed to but that way the user will still not be able to maneuver through the cells by pressing arrow keys as that happens only when a Grid cell is focused. So pressing tab and moving the focus to the Grid cells will be required before the keyboard navigation starts working with the arrow keys. To me, it would make more sense in conjunction with #4658 so the button will also be tabbable and the navigation will feel more natural. @mui/xgrid What do you think? |
Hey @MBilalShafi Considering this section:
There is actually a pretty straight forward definition in the W3C standards to be found here, so the proposed solution from @Isaac1606 is correct. If the menu gets closed (and is not navigating away from the page through an action) the I'd like some more opinions on it though. |
The issue has been inactive for 7 days and has been automatically closed. If you think that it has been incorrectly closed, please reopen it and provide missing information (if any) or continue the last discussion. |
Yes this is an accessibility violation, focus management is part of the ARIA spec. |
Escape
The issue has been inactive for 7 days and has been automatically closed. If you think that it has been incorrectly closed, please reopen it and provide missing information (if any) or continue the last discussion. |
@romgrk if the bot closes this again we should probably move this? Don't know why that got reopened 🤷🏼 |
@michelengelen we forgot to remove the |
No I think the label should stay, to mark that it's the author's turn to respond. Anyway it's a rare case when we keep it open even if the author loses interest. |
Yes, keeping the |
Hey guys any updates on this? or a temporary workaround? Like a wrote in the context section I need to give the users the capability to navigate throughout the entire DataGrid and options using Keyboard only. This a blocker for me sine I can not release the project without this feature. I would truly appreciate any updates, thanks in advance. |
I'll take a look this week. |
So it looks like we're using MUI Core's MenuList, which has an @mui/core Any thoughts on the above? Is there value in adding those capacities to the component? |
This is intentional as far as I know. The root problem as far as I remember is the existence of a GridMenu component, this one shouldn't exist in the first place. It's related to mui/material-ui#38756 and mui/base-ui#39. We should likely have a brand new Popover primitive to replace GridMenu. |
Yeah I figured there's a missing primitive. Is that something I should work on to solve this or is the hacky solution in mui/material-ui#10412 fine for now? Not sure how often you release new components in the core. |
We've integrated mui/material-ui#10412 because that workaround works for now and solves the a11y issue. We should definitely replace |
Do you have a live example for that? |
No, I do not have a live example, but it is pretty straightforward in a DataGrid define a GridActionsCellItem as it follows: |
Let's track this in mui/material-ui#10675, I think we need to discuss other keyboard interactions for GridActionsCellItem. You can subscribe to that issue to get notifications. |
I have been struggling with a similar problem. I want the datagrid column menu to close when the user clicks on a menu item. This click triggers a focus in an input elsewhere in the page. Menu keeps stealing the focus. Even with event propagation stopped on multiple key board and mouse events. Couldn't pin the events I should bypass. So I went for a different way: waiting for the event to finish bubbling by adding the code I want to trigger at the end of the call stack Promise.resolve().then(() => trigger focus action); |
Steps to reproduce 🕹
For Density selector:
Link to live example: https://mui.com/x/react-data-grid/accessibility/#density
Steps:
For GridActionsCellItem with showInMenu enabled:
Link to live example: https://mui.com/x/react-data-grid/accessibility/#density
Steps:
Current behavior 😯
The menu with the set of options disappears (as expected) after one of the options is selected or if the esc button is pressed, but the cursor ceases to exist and there is no focused element whatsoever.
Expected behavior 🤔
Focus should return to the button that caused the menu to appear.
Context 🔦
Give users the capability to navigate throughout the entire DataGrid and options using only Keyboard.
Your environment 🌎
npx @mui/envinfo
Order ID or Support key 💳 (optional)
No response
The text was updated successfully, but these errors were encountered: