FlatList scrollToEnd not working on iOS when items width changes (works on Android/Web) #47974
Labels
Component: FlatList
Needs: Triage 🔍
Platform: Android
Android applications.
Platform: iOS
iOS applications.
Description
I want to automatically scrollToEnd() when changing FlatList item widths from smaller to larger number. However, this behavior does not behave correctly on iOS despite it working on Android and Web. Seems as if the list on iOS scrolls to the end position of the previous calculated offset. Adding a CTA to re-fire the 'Scroll to end' works as expected on all platforms.
Steps to reproduce
Expected behavior is for FlatList to scroll to the end after changing item width from 100 > 200. Logic for this is inside a useEffect that fires after width has changed. This works on Android/web but does not seem to scroll to the correct end location when running on an iOS.
React Native Version
0.75.4 (Where issue was originally discovered, but was able to reproduce with a snack on Expo SDK 52/RN v0.76)
Affected Platforms
Runtime - iOS
Output of
npx react-native info
Reproducer
https://snack.expo.dev/@omniphx/scroll-to-end-when-width-changes
Screenshots and Videos
AIZU2598.MP4
The text was updated successfully, but these errors were encountered: