Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Scrolling through FlatList in React Native does not provide Talkback message in Android

I am using React Native's FlatList component. When user is scrolling through FlatList on Android with TalkBack on, it does not read "showing items ... to ... of ..."

On iOS, scrolling with Voiceover does give feedback (showing page x of y).

I'm wondering if this is a gap in react native's FlatList? Or am I missing some settings?

like image 652
Penguinator Avatar asked Apr 05 '18 00:04

Penguinator


People also ask

How to enable or disable scrolling on flatlist with React Native?

to set the scrollEnabled prop to false to disable scrolling on the FlatList. To enable or disable scrolling on FlatList with React Native, we can set the scrollEnabled prop.

What is the default keyextractor for a flatlist?

By default, the list looks for a key prop on each item and uses that for the React key. Alternatively, you can provide a custom keyExtractor prop. Inherits ScrollView Props, unless it is nested in another FlatList of same orientation.

What does extradata= {selectedid} do in flatlist?

By passing extraData= {selectedId} to FlatList we make sure FlatList itself will re-render when the state changes. Without setting this prop, FlatList would not know it needs to re-render any items because it is a PureComponent and the prop comparison will not show any changes.


1 Answers

There are some conflicting for the talkback as mentioned in the Accessibility api but without a reference code its hard to debug the answer.

Here are a few points to note in the beginning -

  • You need to have accessible elements so that the disable people might use it
  • By default, all touchable elements are accessible.You can pass prop accessible={true} to make the view accessible. It will wrap all its children to a single accessible component
  • Check if the screen reader is active using AccessiblityInfo

    Your issue might lie here

As mentioned

In the case of two overlapping UI components with the same parent, default accessibility focus can have unpredictable behavior.

Therefore you might need to set importantForAccessibility label to resolve this issue and can accept props auto, yes, no and no-hide-descendants

like image 76
Pritish Vaidya Avatar answered Sep 28 '22 19:09

Pritish Vaidya