Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android: Collection Name not supported by Flatlist, SectionList, VirtualizedList, or ScrollView #30972

Closed
4 tasks
amarlette opened this issue Feb 10, 2021 · 2 comments · Fixed by facebook/react-native-website#3224

Comments

@amarlette
Copy link

amarlette commented Feb 10, 2021

Description

Collections on Android have a name defined by their contentDescription property. This name will be announced as part of the "in list" and "out of list" announcements. Since we do not support the list/grid/pager roles, the contentDescription's set on these components don't announce these names upon focus into or out of any descendant elements.

Collection Name not from collection Not supported by:

React Native version:

v0.63

Expected Behavior

If one of the list components has a contentDescription set on it, on first focus into that list, screen readers will announce "in list ". Upon focus out of the list, it should announce "out of list ".

Android Details

This should work properly if any of the collection roles were able to be set, which makes this task dependent on #30839. By adding these roles, and properly setting the contentDescription the collection name should automatically be announced.

@amarlette amarlette changed the title Android: Collection Name not support by Flatlist, SectionList, VirtualizedList, or ScrollView Android: Collection Name not supported by Flatlist, SectionList, VirtualizedList, or ScrollView Feb 10, 2021
@sidverma32
Copy link
Contributor

Hi @amarlette , I would like to work on this. Please guide me with some initial steps on "collection roles" to proceed, that would be helpful.

@fabOnReact
Copy link
Contributor

fabOnReact commented Jul 22, 2022

The accessibilityLabel is correctly announced when adding <FlatList accessibilityRole="grid" accessibilityLabel="my label for Flatlist" .../>.
ReactNative uses the accessibilityLabel prop to set the android contentDescription, but the role grid is not yet documented on the react-native website. I will prepare the documentation.

accessibilityLabel/contentDescrition announced when setting FlatList props accessibilityRole to "grid"

2022-07-25.15-58-39.mp4

same tasks from #30861 (comment)

Improved React Native Accessibility automation moved this from Backlog to Done Jul 27, 2022
roryabraham pushed a commit to Expensify/react-native that referenced this issue Aug 17, 2022
…4267)

Summary:
Adding grid role to ViewAccessibility to fix flow errors.
fixes facebook#30861 fixes facebook#30972

## Changelog

[General] [Fixed] - Adding grid role to ViewAccessibility to fix flow errors.

Pull Request resolved: facebook#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
roryabraham pushed a commit to Expensify/react-native that referenced this issue Aug 17, 2022
…4267)

Summary:
Adding grid role to ViewAccessibility to fix flow errors.
fixes facebook#30861 fixes facebook#30972

## Changelog

[General] [Fixed] - Adding grid role to ViewAccessibility to fix flow errors.

Pull Request resolved: facebook#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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment