Open Bug 2071782 Opened 2 months ago Updated 3 days ago

Customizable Select: Implement proper keyboard navigation for picker

Categories

(Core :: DOM: Core & HTML, task)

task

Tracking

()

ASSIGNED

People

(Reporter: jjaschke, Assigned: jjaschke)

References

(Blocks 1 open bug)

Details

Attachments

(3 external files)

Add focus-based keyboard navigation for <select> pickers using appearance: base-select. Opening the picker should focus the selected option; arrow keys, Home/End, PageUp/PageDown, and type-ahead should move focus without changing selection. Enter or Space should select the focused option and close the picker, returning focus to the select.
Coordinate mouse handling with option focus so opening clicks and click-and-drag selection behave correctly.

WebDriver's Element Send Keys step 7 runs the focusing steps for the
element: https://w3c.github.io/webdriver/#element-send-keys. The container
(the select or datalist of an option, https://w3c.github.io/webdriver/#dfn-container)
only determines interactability in the preceding steps.

Marionette focused the container instead. That was equivalent while options
could never take focus, but the HTML spec makes options of a select rendered
with base appearance focusable areas: keyboard navigation runs the focusing
steps on the option, https://html.spec.whatwg.org/#focus-another-option.
Focusing the select then moves focus away from the option WebDriver was asked
to type into, and the select acts on its selected option instead of the
focused one.

Focus the element when it is keyboard-interactable and fall back to the
container otherwise, which keeps the behavior for options in native selects
and datalists.

Assignee: nobody → jjaschke
Status: NEW → ASSIGNED

Options in an open picker are focusable. Opening the picker focuses the
selected option; arrow keys, Home, End, PageUp and PageDown move focus
without changing the selection; Enter and Space pick the focused option and
close the picker; Tab closes it; type-ahead moves focus. Any arrow key, Space
or Enter opens a closed picker. Hiding the picker focuses the select again.

Mouse down on the select no longer lets the default focus action steal the
focus from the option, and releasing the button over an option that overlaps
the select only picks it after a drag. Mouse down inside the picker no longer
toggles it.

Blocks: 2041789
Attachment #9641925 - Attachment description: Bug 2071782 - Part 2: Implement keyboard focus navigation for the base appearance select picker. r?emilio → Bug 2071782 - Part 2: Improve focus and mouse interaction with base appearance select. r=jjaschke!,emilio!

Arrow keys, Home, End, PageUp and PageDown move focus without changing the
selection if the picker is open; Enter and Space pick the focused option
and close the picker; Tab closes it; type-ahead moves focus.
Space or Enter opens a closed picker.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: