mirror of
https://github.com/getpaseo/paseo.git
synced 2026-10-30 13:13:25 +00:00
fix(app): set aria-checked directly on Switch so toBeChecked() assertions work
RNW's createDOMProps maps direct aria-* props to the DOM but does not
read from accessibilityState.checked. The Switch was relying on the
latter, so no aria-checked attribute was ever rendered — making the
component opaque to screen readers and breaking Playwright's
toBeChecked() assertions in E2E tests. Passing aria-checked={value}
alongside the existing accessibilityState fixes both.
This commit is contained in:
@@ -99,6 +99,7 @@ export function Switch({
|
||||
hitSlop={8}
|
||||
accessibilityRole="switch"
|
||||
accessibilityState={accessibilityState}
|
||||
aria-checked={value}
|
||||
accessibilityLabel={accessibilityLabel}
|
||||
testID={testID}
|
||||
style={pressableStyle}
|
||||
|
||||
Reference in New Issue
Block a user