onViewableItemsChanged no triggered after the first section
See original GitHub issueHello,
I use the Section List to display an alphabetical list of contacts. Each section correspond to a letter of the alphabet. Next to the list, there is a vertical component that display an alphabetical index (A to Z).
I would like to highlight the active section (letter) on this component. For that, the onViewableItemsChanged
callback seems to be the answer.
However, it is not working as expected.
The event is only fired for the first section (in my contact app example, for the letter “A”). When the user scroll to the next section, the event is not triggered at all.
Thanks
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
FlatList onViewableItemsChanged method does't trigger when ...
When first enter the page , onViewableItemsChanged method will trigger without scroll event ! My code just like this: const VIEWABILITY_CONFIG = ...
Read more >React Native "onViewableItemsChanged" not working while ...
I have a React Native FlatList. base on Documentation I used onViewableItemsChanged for getting the current showing item on the screen ...
Read more >Understand onViewableItemsChanged in FlatList - RY 's Blog
onViewableItemsChanged is a prop in VirtualizedList and FlatList. When you scroll a FlatList, the items showing on the FlatList change. Then, ...
Read more >VirtualizedList - React Native Archive
Used to handle failures when scrolling to an index that has not been measured yet. Recommended action is to either compute your own...
Read more >How to avoid rendering non-changing items on React Native ...
After creating some sections with FlatList components to render a list ... to open the section container, and clicking on an item to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hey. I guess I’ve found the problem. All you need to do is to patch
BigList.js
. The problem is in this line https://github.com/marcocesarato/react-native-big-list/blob/a50c24922e0f83226ba30a3626ab32bba74733d7/lib/BigList.jsx#L584You need to replace
section[sections]
withsection[s]
To patch the package you need to change it in
react-native-big-list/dist/commonjs/BigList.js
Hello,
I’ve installed the last release (version 1.5.3). I can confirm that the bug is now fixed. The event
onViewableItemsChanged
is now triggered for each section of the list.Again, thank you @labtorie @marcocesarato.
Have a nice day