N/A
lint/a11y/noNoninteractiveTabindex
Both treegrid and grid are described to work like spreadsheets on the web, where data can be edited and individual cells can be focused within and navigated using arrow keys.
Treegrid takes it one step further and allows expanding/collapsing of rows and columns like a tree.
So when trying to implement focus behavior, this throws an error when it shouldn’t:
// The HTML element div is non-interactive. Do not use tabIndex. (❌ Incorrect)
<div role="gridcell" tabIndex={0}>
~~~~~~~~~~~~
This conflicts with the recommended behavior of treegrid children:
Right Arrow
If focus is on a collapsed row, expand the row. …
In other words, a gridcell MUST be focusable when inside a treegrid if it’s expandable (via tabIndex
), and also MUST be able to receive other keyboard commands.
lint/a11y/noNoninteractiveTabindex
is correct in other instances, so it seems this is only a problem with grid and treegrid children.
useSemanticElements
rule does apply to this example but is irrelevant; noNoninteractiveTabindex still raises the same errorstabIndex={0}
and everything else gets tabIndex={-1}
), but also doesn’t affect the outcomePay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too