Skip to content

[DataGrid] Restore focus after dismissing column menu #5027

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

Merged
merged 1 commit into from
Jun 1, 2022

Conversation

m4theushw
Copy link
Member

@m4theushw m4theushw commented May 26, 2022

Preview: https://deploy-preview-5027--material-ui-x.netlify.app/x/react-data-grid/demo/

Fixes #1873

This bug happens because, when the column menu is closed, the browser puts focus back to the menu button. However, this button only appears on hover. The problem is that as soon as it receives focus it becomes invisible and the focus is moved to the <body>. The solution I used is to focus the column header when I detect that the menu button was focused because the column menu was closed (checking event.relatedTarget). Like #1873, we also have problem in the panels (columns and filters). We don't restore the focus to any element, making it difficult to navigate via keyboard. I'll open another issue for them.

@m4theushw m4theushw added accessibility a11y component: data grid This is the name of the generic UI component, not the React module! new feature New feature or request labels May 26, 2022
@mui-bot
Copy link

mui-bot commented May 26, 2022

These are the results for the performance tests:

Test case Unit Min Max Median Mean σ
Filter 100k rows ms 344.9 633.4 408.5 439.32 100.345
Sort 100k rows ms 530.4 906.1 859.6 794.44 135.917
Select 100k rows ms 126.9 392.4 193.9 229.96 90.214
Deselect 100k rows ms 160.5 284.1 213.4 216.64 40.072

Generated by 🚫 dangerJS against 8fff272

Copy link
Member

@cherniavskii cherniavskii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great accessibility improvement!

@m4theushw m4theushw merged commit d0c85da into mui:master Jun 1, 2022
@m4theushw m4theushw deleted the restore-column-header-focus branch June 1, 2022 22:46
joserodolfofreitas pushed a commit to joserodolfofreitas/mui-x that referenced this pull request Jun 13, 2022

Partially verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
We cannot verify signatures from co-authors, and some of the co-authors attributed to this commit require their commits to be signed.
alexfauquette pushed a commit to alexfauquette/mui-x that referenced this pull request Aug 26, 2022

Partially verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
We cannot verify signatures from co-authors, and some of the co-authors attributed to this commit require their commits to be signed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accessibility a11y component: data grid This is the name of the generic UI component, not the React module! new feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[DataGrid] MuiDataGridMenu focus location on exit is not accessible
4 participants