dgrid
dgrid copied to clipboard
contentNode gets tabIndex="0" when no collection is provided during instantiation
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
.
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).
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.
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?