question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

onViewableItemsChanged no triggered after the first section

See original GitHub issue

Hello,

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:closed
  • Created 2 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
labtoriecommented, Feb 23, 2022

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#L584

You need to replace section[sections] with section[s]

To patch the package you need to change it in react-native-big-list/dist/commonjs/BigList.js

0reactions
guicaracommented, Feb 23, 2022

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found