Animating .scrollTo() / .scrollToIndex() ❓
See original GitHub issueHi there 😃
Thanks for this great lib!
I’m experimenting with it and I wondered whether it’s somehow possible to animate the scrolling behavior (“smooth scroll”) when using scrollTo()
/ scrollToIndex()
?
Issue Analytics
- State:
- Created 5 years ago
- Comments:13 (2 by maintainers)
Top Results From Across the Web
React Native scrollToIndex - Dynamic size item scroll inside ...
In this video tutorial you will learn about React Native scrollToIndex and how to scroll to an item inside a FlatList, ListView, ScrollView, ......
Read more >RN Animated.FlatList ScrollToIndex(0) causes Flashing ...
I'm trying to create a carousel with infinite looping on finite set of data using FlatList and am using ScrollToIndex to scroll to...
Read more >scrollToItem(at:at:animated:) | Apple Developer Documentation
Instance Method. scrollToItem(at:at:animated:) Scrolls the collection view contents until the specified item is visible. iOS 6.0+ iPadOS 6.0+ Mac Catalyst ...
Read more >scrollTo | React Native Reanimated - Software Mansion
Provides synchronous scroll on the UI thread to a given offset using an animated ref to a scroll view. This allows performing smooth...
Read more >FlatList scrollToIndex practical example. - Expo Snack
FlatList scrollToIndex practical example. No description. Open with Expo Go. Open in editor. Need Expo? Don't have the Expo Go? Download the app...
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
Just add to your global or component styles:
IMHO, the simplest and most elegant solution, I don’t understand why no one suggested it
This is easier to do with the
outerRef
prop which gives you a reference to the scrollable div.You could then use that in combination with the standard Element.scrollTo() API.
So it would something along the lines of this:
NOTE: I removed all the extraneous code and props above to keep things brief.