Skip to content

Commit 5ddb997

Browse files
fabOnReactfacebook-github-bot
authored andcommitted
Adding grid role to ViewAccessibility to fix flow errors. (#34267)
Summary: Adding grid role to ViewAccessibility to fix flow errors. fixes #30861 fixes #30972 ## Changelog [General] [Fixed] - Adding grid role to ViewAccessibility to fix flow errors. Pull Request resolved: #34267 Test Plan: <details><summary>flow error for missing accessibilityRole type grid</summary> <p> <image src="https://user-images.githubusercontent.com/24992535/180728969-beccb7f7-d882-4a94-831d-1c08822fc030.png" width="800" /> </p> </details> <details><summary>adding grid role to ScrollView</summary> <p> https://user-images.githubusercontent.com/24992535/180721100-62de76af-ea23-44a6-816e-f6fa39835b77.mp4 </p> </details> <details><summary>adding grid role to FlatList</summary> <p> https://user-images.githubusercontent.com/24992535/180724852-861c2981-0b06-4c66-a983-0017785062fe.mp4 </p> </details> <details><summary>adding grid role to SectionList</summary> <p> https://user-images.githubusercontent.com/24992535/180788810-d1869381-1e6b-42aa-b9b2-a84aece41326.mp4 </p> </details> Reviewed By: NickGerleman Differential Revision: D38121921 Pulled By: dmitryrykun fbshipit-source-id: 3bc335b3a525e75ae2e032f6a35540b3e95cd6a8
1 parent 88b7b64 commit 5ddb997

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

Libraries/Components/View/ViewAccessibility.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ export type AccessibilityRole =
4343
| 'tablist'
4444
| 'timer'
4545
| 'list'
46-
| 'toolbar';
46+
| 'toolbar'
47+
| 'grid';
4748

4849
// the info associated with an accessibility action
4950
export type AccessibilityActionInfo = $ReadOnly<{

packages/rn-tester/js/examples/ScrollView/ScrollViewExample.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,7 @@ const examples = ([
205205
return (
206206
<View>
207207
<ScrollView
208+
accessibilityRole="grid"
208209
ref={scrollView => {
209210
_scrollView = scrollView;
210211
}}

0 commit comments

Comments
 (0)