WordPress / wp20.wordpress.net

Celebrating 20 years of WordPress
5 stars 1 forks source link

Can't tab to locale search field #70

Closed iandunn closed 1 year ago

iandunn commented 1 year ago
  1. Load the home page and start tabbing through the items until you reach the Swag link
  2. Hit tab one more time, which will take you to #select2-wp20-locale-switcher-container
  3. Hit enter to open the menu
  4. The focus is on the currently selected locale, and you can arrowup / arrowdown to move between them
  5. Hit shift-tab to go to the search field, and it will close the list and take you back to #select2-wp20-locale-switcher-container instead of moving the focus to the search input.
iandunn commented 1 year ago

Oh, huh, the selectWoo demo behaves the same way. The select2 demo focuses the caret in the search field like I'd expect, though. That seems really odd, given that selectWoo was designed to fix the a11y problems with select2 🤔

The selectWoo demo does still let you search, though, with a sequence like this:

  1. Tab to list
  2. Hit enter
  3. Start typing

There's no visual affordance that you can/should start typing, though, which seems odd. Our instance doesn't work with a sequence like that.

iandunn commented 1 year ago

It may be a known issue in selectWoo, and fixed in latest version of select2.

It may be better to just replace it with something that was designed to be accessible though, like alphagov/accessible-autocomplete. I'll try that out.