mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Switch: Improve Accessibility
Summary: On Android, `Switch` does not currently read its role as a "button". This fixes that and makes it consistent with iOS. Reviewed By: sahrens Differential Revision: D13136253 fbshipit-source-id: 0de5d54772d204168138cb2af7815cc458f72682
This commit is contained in:
committed by
Lorenzo Sciandra
parent
c43b74193a
commit
83d1e85263
@@ -164,6 +164,7 @@ class Switch extends React.Component<Props> {
|
||||
<SwitchNativeComponent
|
||||
{...props}
|
||||
{...platformProps}
|
||||
accessibilityRole={props.accessibilityRole ?? 'button'}
|
||||
onChange={this._handleChange}
|
||||
onResponderTerminationRequest={returnsFalse}
|
||||
onStartShouldSetResponder={returnsTrue}
|
||||
|
||||
Reference in New Issue
Block a user