Closed Bug 2001218 Opened 1 year ago Closed 5 months ago

Support arrow-controlled components in moz-box-group[type=list]

Categories

(Toolkit :: UI Widgets, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
153 Branch
Tracking Status
firefox152 --- fixed
firefox153 --- fixed

People

(Reporter: mstriemer, Assigned: akulyk)

References

(Blocks 1 open bug)

Details

(Keywords: access, Whiteboard: [recomp] [srdbb])

Attachments

(2 external files, 1 obsolete file)

When we have a <moz-box-group type="list"> then the tab order is managed by the component to support using arrow keys to move up/down/left/right within the row and to avoid including each row in the tab order. This causes some issues if there are focusable elements within a row that already handle arrow keys natively, like select and <input type="radio">, since we either need to e.preventDefault() when we move focus and their default behaviour stops working, or we skip up/down/left/right support on these elements (when applicable) and won't be able to move focus up/down anymore

We should be able to work around this by adding a mode to moz-box-item to include it in the tab order, and not running the move focus handler on elements that support arrow keys natively (when that key performs some action, ie we should still support left/right on a select).

When you have a group of box items with selects (like this Figma) in them the focus should go like this:

  1. Tab -> first row is focused
  2. Tab -> select in first row is focused
  3. Up/Down -> select value changes/menu opens (platform specific default behaviour)
  4. Shift+Tab -> first row is focused
  5. Tab -> Focus moves out of group
  6. Shift+Tab -> last row is focused
  7. Up -> second last row is focused
Whiteboard: [recomp] → [recomp] [srdbb]

This isn't a blocker, but seems to be well scoped. Should be lower priority

Assignee: nobody → tgiles
Status: NEW → ASSIGNED
Attached file WIP: Bug 2001218 - init investigation (obsolete) —

Attaching my WIP to this bug as I believe this is a bit bigger than we originally estimated. I think we need to enumerate the cases for moving around in the list when there are certain elements as handling the selection and focus logic gets complicated quickly from my investigation.

Dropping this to focus on more actionable tasks.

Assignee: tgiles → nobody
Status: ASSIGNED → NEW
Blocks: 1965590
Keywords: access

It sounds like this mode would get us at least part of the way towards the consistent keyboard navigation solution mentioned here, as well as address some of the issues that surfaced in this bug.

We may need some input from a11y folks on whether or not we want all moz-box-groups and the elements within them to be keyboard focusable regardless of whether or not they contain interactive elements, or if we just need to use this mode for lists and reorderable lists (I think it's the latter, but we should confirm).

Blocks: 2019492
Assignee: nobody → akulyk
Status: NEW → ASSIGNED
Pushed by akulyk@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/01286eb191a4 https://hg.mozilla.org/integration/autoland/rev/7eb92c64ee08 Support arrow-controlled components in moz-box-group r=desktop-theme-reviewers,tgiles
Pushed by akulyk@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/d6c642ca1b40 https://hg.mozilla.org/integration/autoland/rev/00d9ce469605 Support arrow-controlled components in moz-box-group r=desktop-theme-reviewers,tgiles
Flags: needinfo?(akulyk)
Status: ASSIGNED → RESOLVED
Closed: 5 months ago
Resolution: --- → FIXED
Target Milestone: --- → 153 Branch
Attachment #9591315 - Flags: approval-mozilla-beta?
Flags: in-testsuite+
Attachment #9591315 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Regressions: 2044597
Attachment #9531609 - Attachment is obsolete: true
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: