Skip to content

New rule: Flag elements with tabindex >= 0 without semantics that signal interactivity (Best Practice) #632

@0ddfell0w

Description

@0ddfell0w

Flag elements inserted into focus order without semantics that signal interactivity.

Checks that all elements without an aria role have a tabindex value of -1. Elements without an interactive role (implicit or explicit) are unexpected in the tab order.

Tags: cat.keyboard
Impact: minor

Selector

div, span, p, and heading elements inserted into the focus order


Checks

keyboard/focus-order-semantics

Passes if

  • element has role of type widget or composite OR
  • element has a tag name that implies it might scroll1 OR
  • element has a role that implies it might scroll2

Other, generate a violation

1 Tags for scrollable elements: article, section, nav, aside
2 Roles for scrollable elements: article, complementary, contentinfo, directory, document, form, main, navigation, region

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions