Giter Club home page Giter Club logo

Comments (2)

kevin-brown avatar kevin-brown commented on September 27, 2024

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.

from select2.

jefflord avatar jefflord commented on September 27, 2024

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:

  1. This is not a select input anymore, it's a "custom user control", and now has more responsibility than select element alone has. With great power comes great responsibility.
  2. Delete does nothing I can tell, and backspace does work, but it's weird. These "issues", a) you need to hit backspace and then esc to quickly remove an item and b) you can only remove the last item.
  3. Having any action-button that cannot be accessed with the KB is bad. This makes sense to me and comes from complaints I have received from paid "Level Access" evaluations.

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?

from select2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.