react-native-web icon indicating copy to clipboard operation
react-native-web copied to clipboard

Scrolling to index in lists uses wrong offset when content sizes has changed

Open AndreasHogstrom opened this issue 3 years ago • 1 comments

The problem

Scrolling to index positions in lists (FlatList, SectionList, VirtualizedList) uses the wrong offset if the sizes of items before the wanted index have changed size.

How to reproduce

Simplified test case: https://codesandbox.io/s/practical-khorana-gfcu1z?file=/src/App.js

Steps to reproduce: Click the 3 buttons at the top of the example in order and observe the behaviour of the FlatList.

Expected behavior

ScrollToIndex (and related functions) should scroll to the correct offset even when content sizes dynamically change.

Environment (include versions). Did this work in previous versions?

  • React Native for Web (version): 0.18.2
  • React (version): 17.0.2
  • Browser: Chrome, Safari (Doesn't seem browser related)

AndreasHogstrom avatar Jun 29 '22 13:06 AndreasHogstrom

i have same issue

huuanhopp avatar Aug 03 '23 04:08 huuanhopp