Skip to content

Commit

Permalink
Adding grid role to ViewAccessibility to fix flow errors. (#34267)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
fabOnReact authored and facebook-github-bot committed Jul 27, 2022
1 parent 88b7b64 commit 5ddb997
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Libraries/Components/View/ViewAccessibility.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ export type AccessibilityRole =
| 'tablist'
| 'timer'
| 'list'
| 'toolbar';
| 'toolbar'
| 'grid';

// the info associated with an accessibility action
export type AccessibilityActionInfo = $ReadOnly<{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ const examples = ([
return (
<View>
<ScrollView
accessibilityRole="grid"
ref={scrollView => {
_scrollView = scrollView;
}}
Expand Down

0 comments on commit 5ddb997

Please sign in to comment.