New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question on commit 181170f, delete button/tabindex #6312
Comments
The clear button is not focusable by standard keyboards without assistance. Select2 has key bindings for triggering the clear button (DELETE I believe, BACKSPACE in some cases) for those without tools overriding standard key bindings. The challenge with tabbing in general is that Select2 first and foremost needs to replicate a standard select box. And a standard select box doesn't have a bonus clear button, so if it showed up in the natural tab order then it wouldn't be meeting that goal. But we have key bindings that try their best to accommodate for this following industry standards (WAI-ARIA primarily, browser engines when they don't cover it) to make up for this gap. |
kevin-brown Thanks for the reply. I am very glad that actual thought was given to this topic. I now understand that what is meant by "the natural tab order of the select box" is the "usual way tab works for a normal select element". I can respect that. However, the issues are these:
I have no issues with changing my local select2, changing it to have a tabindex on these buttons, but it seems like it should be that way already. Another option, which I think would be in line with WCAG, would be to use the arrow keys to focus the delete buttons. I think this would address KB access to the buttons AND preserve "the natural tab order of the select box". What do you think? |
@kevin-brown or anyone else, in this commit, 181170f, it says
While I love all the changes from this commit, and agree with this being changed to a button, I don't understand the tabindex and the "the natural tab order of the select box".
With tabindex="-1", KB only user cannot tab-to or access this item to delete. Can anyone explain why tabindex="-1" helps or fixes? I update the DOM to "correct" this and it works great for me. I just wonder why it's not the default.
Thanks
The text was updated successfully, but these errors were encountered: