From e3e635ef84156a5283d378858f7c8deb44464fea Mon Sep 17 00:00:00 2001 From: Gabriel Donadel Dall'Agnol Date: Mon, 31 Oct 2022 04:47:35 -0700 Subject: [PATCH] feat: Add "option" to available role values (#35137) Summary: As pointed out by efoken on https://github.com/facebook/react-native/issues/34424#issuecomment-1283854395 we forgot we add the `option` value to the `role` prop, so this PR adds this missing value as requested on https://github.com/facebook/react-native/issues/34424. ## Changelog [General] [Added] - Add "option" to available role values Pull Request resolved: https://github.com/facebook/react-native/pull/35137 Test Plan: Ensure that CI is green as there isn't much to test in this case because we're just adding a value that maps to `undefined` Reviewed By: jacdebug Differential Revision: D40849497 Pulled By: NickGerleman fbshipit-source-id: 5e3e24c0ff05c361a7a8dc1ee1f20ba3fb6988ca --- Libraries/Components/View/ViewAccessibility.d.ts | 1 + Libraries/Components/View/ViewAccessibility.js | 1 + Libraries/Utilities/AcessibilityMapping.js | 2 ++ 3 files changed, 4 insertions(+) diff --git a/Libraries/Components/View/ViewAccessibility.d.ts b/Libraries/Components/View/ViewAccessibility.d.ts index 5fad1607d973cb..c68c758410c889 100644 --- a/Libraries/Components/View/ViewAccessibility.d.ts +++ b/Libraries/Components/View/ViewAccessibility.d.ts @@ -330,6 +330,7 @@ export type Role = | 'navigation' | 'none' | 'note' + | 'option' | 'presentation' | 'progressbar' | 'radio' diff --git a/Libraries/Components/View/ViewAccessibility.js b/Libraries/Components/View/ViewAccessibility.js index 729e5e0a32e5b8..c62be022b046e7 100644 --- a/Libraries/Components/View/ViewAccessibility.js +++ b/Libraries/Components/View/ViewAccessibility.js @@ -85,6 +85,7 @@ export type Role = | 'navigation' | 'none' | 'note' + | 'option' | 'presentation' | 'progressbar' | 'radio' diff --git a/Libraries/Utilities/AcessibilityMapping.js b/Libraries/Utilities/AcessibilityMapping.js index 8db68118821dd8..911f3381089fe9 100644 --- a/Libraries/Utilities/AcessibilityMapping.js +++ b/Libraries/Utilities/AcessibilityMapping.js @@ -92,6 +92,8 @@ export function getAccessibilityRoleFromRole(role: Role): ?AccessibilityRole { return 'none'; case 'note': return undefined; + case 'option': + return undefined; case 'presentation': return 'none'; case 'progressbar':