a11y-todos

Expand History Expand History
Collapse History Collapse History

Treat Lists as separate tab stops

Declare the TabstopList Stimulus controller, along with the trapFocus() and navigate() actions.

When a list gains focus, find all focusable elements (like <button>, <input>, <select>, etc), and prevent focus by [setting their [tabindex="-1"]][mdn-tabindex-1]. Then, re-set the focused element’s [tabindex="0"] to treat it as the place to resume once focus is regained.

To go along with that restriction, treat the up and down arrows as keyboard shortcuts to move between focusable items in the list, and add a System Test to exercise that behavior.

To make assertions about focus state, add a dependency on the capybara_accessible_selectors gem to augment the standard set of Capybara selectors and filters.