You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Switch: a read-only Switch inside a switch row still renders role="switch", so web reports nested interactive controls #5245
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?
Run the example app on the web from main (yarn install, then npx expo start --web in example/).
Open TextInput from the examples list and scroll to the Controls section, or open Floating Action Button and find the "Show FAB" row.
Run axe-core on the page (for example with the axe DevTools extension), in the light or dark theme.
Activity
fix(switch): hide a read-only switch in a switch row with aria-hidden (…