Focusable element under aria-hidden

a11y/aria-hidden-focuserroraccessibilitylighthouse

Why it matters

Keyboard focus reaches an element screen readers can't see (Lighthouse: [aria-hidden] elements contain focusable descendants).

Fix

Add tabIndex={-1} to the focusable element, or remove aria-hidden.

Credit

  • From Deque

    The axe rule aria-hidden-focus forbids focusable elements inside aria-hidden content.

References