Skip to content
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] Change ColumnsHeader component tabIndex to -1 #478

Merged
merged 4 commits into from
Oct 21, 2020

Conversation

DanailH
Copy link
Member

@DanailH DanailH commented Oct 20, 2020

I've accidentally set a tabIndex="0" on the ColumnsHeader component. I'm setting it to -1 since now it focuses the entire row.

PS: We need the tabIndex because without it the linter fails with Elements with the 'row' interactive role must be focusable. That is because that same div has a role=row

Copy link
Member

@oliviertassinari oliviertassinari left a comment

Choose a reason for hiding this comment

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

I don't think that the row should be focusable. I don't think that it makes sense to give the row focus on click or to allow a programmatic focus. We can silence the eslint rule: https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/master/docs/rules/interactive-supports-focus.md#rule-details

packages/grid/_modules_/grid/components/column-headers.tsx Outdated Show resolved Hide resolved
@DanailH DanailH self-assigned this Oct 20, 2020
@oliviertassinari oliviertassinari added bug 🐛 Something doesn't work component: data grid This is the name of the generic UI component, not the React module! labels Oct 21, 2020
Co-authored-by: Olivier Tassinari <olivier.tassinari@gmail.com>
@DanailH DanailH merged commit 150b607 into mui:master Oct 21, 2020
dtassone pushed a commit to dtassone/material-ui-x that referenced this pull request Nov 9, 2020
* [DataGrid] Change ColumnsHeader component tabIndex to -1

* Add eslint-disable-next-line and remove unwanted tabIndex

* Update packages/grid/_modules_/grid/components/column-headers.tsx

Co-authored-by: Olivier Tassinari <olivier.tassinari@gmail.com>

Co-authored-by: Olivier Tassinari <olivier.tassinari@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work component: data grid This is the name of the generic UI component, not the React module!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants