Problem/Motivation

The created widget has a tab index of 0, but also an 'unselectable' attribute. It's not actually possible to tab to it since it has a display: none; set, so its somewhat redundant.

Steps to reproduce

Proposed resolution

jquery-ui already has a similar solution in place.

See https://web.dev/control-focus-with-tabindex/#remove-an-element-from-the-tab-order and https://www.456bereastreet.com/archive/201108/do_not_use_displaynone_to_visually_hide_content_intended_for_screen_readers/

This removes an element from the natural tab order, but the element can still be focused by calling its focus() method.

The tabIndex can be updated to be removed or set to -1 (to be more explicit) so that it's no longer focusable.
The autocomplete dropdown is only ever visible whenever the input field is in focus anyway making it impossible to tab into otherwise making its existence somewhat irrelevant lol.

Remaining tasks

Provide patch/issue fork.

User interface changes

N/A.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

codebymikey created an issue. See original summary.

codebymikey’s picture

drunken monkey’s picture

Component: General code » User interface
Status: Needs review » Fixed

Makes sense, thanks a lot!
Merged.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.