mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-24 04:16:00 +08: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
Facebook Github Bot
parent
2ae559a2a4
commit
0c8db08f51
@@ -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