dgrid icon indicating copy to clipboard operation
dgrid copied to clipboard

contentNode gets tabIndex="0" when no collection is provided during instantiation

Open bryanforbes opened this issue 8 years ago • 3 comments

I'm creating a grid with no collection and tabableHeader: false. When I tab into it, focus goes initially to contentNode because it has tabIndex="0". This is caused by https://github.com/SitePen/dgrid/blob/a3577b6a56ee7ab234f7d22113c196884c8f9ec4/Keyboard.js#L104-L129 not resetting the tab index of focusedNode.

bryanforbes avatar Sep 10 '15 18:09 bryanforbes

There is a PR for this in #1221 but I am tempted to hold off until we can ascertain whether this would have an undesirable impact on accessibility (e.g. making "No results" messages inaccessible).

kfranqueiro avatar Jan 05 '16 20:01 kfranqueiro

Something to think about...

The no data message property can contain HTML. So a dev could used something like <div>no data here</div> and give that DIV a tabIndex or an a11y role or whatever is necessary to make it accessible.

edhager avatar Jan 06 '16 00:01 edhager

Another thing I thought of that makes me feel iffy about this:

Let's say you have a Keyboard List or Grid that lists records and under it are some buttons like "Add New". If we make this change, the number of tab keypresses to get to the "Add New" button is inconsistent depending on whether there are any existing records or not. That seems like it'd be an annoying UX fail to people with disabilities or users who just prefer using the keyboard for efficiency.

What was the original use case where the existing (but arguably consistent, in terms of number of tab stops in the page) behavior was undesirable?

kfranqueiro avatar Jan 08 '16 05:01 kfranqueiro