From 36672c3851a044a1ab0edcfaa2790c02f7909695 Mon Sep 17 00:00:00 2001 From: Matias Alvin Date: Fri, 18 Oct 2019 22:12:50 -0700 Subject: [PATCH] Fix Switch component accessibility role (#26899) Summary: `accessibilityRole` communicates the purpose of a component to the user of assistive technology. It needs to have the correct value for it to be fully utilized. Switch component has `accessibilityRole` of a `button` instead of `switch` on default. Change the component default role to `switch`. ## Changelog [General] [Fixed] - Change default `accessibilityRole` of Switch component from `button` to `switch` Pull Request resolved: https://github.com/facebook/react-native/pull/26899 Test Plan: - All unit test passed - On Switch component, it's supposed to have `switch` like element type on both platform. (`XCUIElementTypeSwitch` on iOS) fix [https://github.com/facebook/react-native/issues/26873](https://github.com/facebook/react-native/issues/26873) Reviewed By: yungsters Differential Revision: D18002755 Pulled By: mdvacca fbshipit-source-id: 60446f94b23f8355f954805fb4dc08c89d08e492 --- Libraries/Components/Switch/Switch.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Libraries/Components/Switch/Switch.js b/Libraries/Components/Switch/Switch.js index 8a915a02f35ddd..dff75ab13f5499 100644 --- a/Libraries/Components/Switch/Switch.js +++ b/Libraries/Components/Switch/Switch.js @@ -156,7 +156,7 @@ class Switch extends React.Component { {