question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[FlexTable] Disable tabindex on rows

See original GitHub issue

Would it be possible to have an option to disable the tabindex on rows like you can disable the tabindex on the complete FlexTable by using tabIndex={null}?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

7reactions
pimterrycommented, Oct 4, 2018

@bvaughn sorry to bring this back from the dead, but I’ve just run into it trying to make my app accessible, and I don’t think you’re totally right. Right now, I don’t agree the current tabindex behaviour is a11y friendly.

https://developer.mozilla.org/en-US/docs/Web/Accessibility/Keyboard-navigable_JavaScript_widgets is a good guide to this. The relevant snippet:

For grouping widgets such as menus, tab panels, grids, or tree views, the parent element should be in the tab order (tabindex=“0”), and each descendent choice/tab/cell/row should be removed from the tab order (tabindex=“-1”). Users should be able to navigate the descendent elements using arrow keys.

This references the WAI-ARIA Authoring Practices, which has a lot more detailed content on this. There’s a few relevant points in there, but it very closely agrees with the MDN summary, e.g. under ‘Fundamental Keyboard Navigation Conventions’:

A primary keyboard navigation convention common across all platforms is that the tab and shift+tab keys move focus from one UI component to another while other keys, primarily the arrow keys, move focus inside of components that include multiple focusable elements.

Right now, because tabindex=0 is set on all rows within the table, these recommendations aren’t followed, and indeed are impossible to follow. Every single row of the table, and the table itself, are treated as top-level UI components, which isn’t correct and is hard to use.

Instead, the table should have tabindex=0, rows within should have tabindex=-1, and JS should be used to ensure that the arrow keys manage focus within those rows correctly. MDN has two recommended approaches to do exactly that: https://developer.mozilla.org/en-US/docs/Web/Accessibility/Keyboard-navigable_JavaScript_widgets#Managing_focus_inside_groups.

If you want to really dig into it, there’s an ‘interactive tabular data’ section in the ARIA doc that exactly describes this case and covers the suggested behaviour & keyboard shortcuts in full: https://www.w3.org/TR/wai-aria-practices-1.1/#grid

For now I’m going to fix this in my app by replacing the table rowRenderer to fix tabindexes, and managing focus with onKeyDown. Would you be interested in a PR to apply that change here too?

0reactions
levrikcommented, Jul 23, 2016

@bvaughn I have two tables side by side in some type of container with two search fields above. I want that the user is to be able to switch with Tab between these search fields. There should be at the maximum the focus-step to the table between these two. Additionally the table itself implements an onRowClick and an onRowDoubleClick. The double click action is the main action. I want to implement a keyboard control with the arrow keys (up and down) for the onRowClick action and a Space or Enter for the onRowDoubleClick action. But this is not possible if the tabIndex is active on the rows. The selection (or focus) that is done by the arrow keys or the click handler is a Redux action. I want to be able to control the focus from outside by actions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

GWT. How to change flex table's column width? - Stack Overflow
Try FlexTable.getColumnFormatter().setWidth(column, width);. For example, I just tried table.getColumnFormatter().setWidth(0, "400px");.
Read more >
flextable.pdf
The values are inserted in existing columns of the input data of the flextable. Rows can be inserted at the top or the...
Read more >
Bootstrap Cheat Sheet v441 To Help With Web Development
</h1> <div class="row"> <div class="col-sm-6">Left Column</div> <div ... flex, inline-flex, table, table- cell, print-table-row) .disabled .display-(1, 2, ...
Read more >
A Responsive Accessible Table - Adrian Roselli
The table from the example with CSS disabled as heard in NVDA. I am using table navigation controls. NVDA announces the number of...
Read more >
react-virtualized | Yarn - Package Manager
... height is no longer subtracted from overall (rows) height if header is disabled. ... role , and tabIndex get attached to FlexTable...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found