fix tabindex for initial rendering dropdown items #39
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "more-accessibility-improvements"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
When the items in a dropdown are rendered, they should also have their
tabindexset to-1for all items except the first focusable item.Shouldn't they just be all set to -1, and then rely on the opening action to both set the proper initial focusIndex and mark that one as focusable?
Also, it seems like a good idea to make opening a submenu via the click handler move focus into that menu. Opening a top-level drop-down already does this. I guess the focus logic currently in
btn.addEventListener("keydown"should go intoopenSubmenu?That's possible as well -- although it is possible to open a submenu without focusing the first item in the submenu, using the "Enter" or "Space" keys instead of the "RightArrow" key. If we solve it that way, then opening the submenu with "Enter" or "Space" would result in all items in the submenu having
tabindex="-1", which is not quite the expected behavior, but also not such a big deal. The user is probably aware at this point that they are supposed to navigate through the toolbar using the arrow keys, not by tabbing.That seems reasonable to me -- but if you want to maintain focus on the editor when using the mouse, you'll need to test the
e.detailattribute to see if theclickevent was triggered by the mouse or by the keyboard.Attached patch initializes these with tabindex -1.
Pull request closed