Skip to content

Switch: a read-only Switch inside a switch row still renders role="switch", so web reports nested interactive controls #5245

Closed

Description

@Doberjohn

Current behaviour

The migration guide's "Switches without onValueChange" section recommends a pressable row with role="switch" and aria-checked around a <Switch value={...} readOnly /> in a View with aria-hidden and pointerEvents="none". On web the read-only Switch still renders an element with role="switch", tabindex="-1" and aria-readonly, so the row nests an interactive control. axe-core reports nested-interactive (serious): "Interactive controls must not be nested", with "Using a negative tabindex on an element inside an interactive control does not prevent assistive technologies from focusing the element (even with aria-hidden="true")". The example app follows the guide's pattern on the TextInput screen (the Controls rows) and the Floating Action Button screen (the "Show FAB" row).

Expected behaviour

A Switch shown only as a state indicator inside a row that already has role="switch" isn't exposed as a second interactive control: a readOnly Switch given aria-hidden renders no role and no tabIndex, and axe reports no nested-interactive violation. The guide's sample puts aria-hidden on the Switch.

How to reproduce?

  1. Run the example app on the web from main (yarn install, then npx expo start --web in example/).
  2. Open TextInput from the examples list and scroll to the Controls section, or open Floating Action Button and find the "Show FAB" row.
  3. Run axe-core on the page (for example with the axe DevTools extension), in the light or dark theme.

Your Environment

software version
browser Chromium 157
react-native 0.88.1
react-native-paper main (677ab9f)
expo sdk 58

Activity

  1. added this to the 6.0.0 milestone on Nov 19, 2026
  2. self-assigned this
    on Nov 19, 2026
  3. added a commit that references this issue on Nov 20, 2026
    0595199
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions