Skip to content

Focus guards in floating-ui cause an aXe violation #4832

@fabb

Description

@fabb

Product

axe-core

Product Version

4.10.0

Latest Version

  • I have tested the issue with the latest version of the product

Issue Description

Expectation

aXe should only report actual problems. Focus guards in libs like floating-ui should not cause an aXe violation.

Actual

Focus guards that use tabIndex=0 while being aria-hidden=true cause an aXe violation:

Focusable content should have tabindex="-1" or be removed from DOM

How to Reproduce

Show a tooltip with floating-ui, or alternatively add focus guards manually:

<span data-type="outside" tabindex="0" aria-hidden="true" data-floating-ui-focus-guard="" style="border: 0px; clip: rect (0px, 0px, 0px, 0px); height: 1px; margin: -1px; overflow: hidden; padding: 0px; position: fixed; white-space: nowrap; width: 1px; top: 0px; left: 0px;"></ span>

Additional context

see floating-ui/floating-ui#3364

Metadata

Metadata

Assignees

No one assigned

    Labels

    fixBug fixesrulesIssue or false result from an axe-core rule

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions