software-mansion / software-mansion/react-native-reanimated
No layout animation on last item of list components
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 11k
- Forks
- 1.5k
- Avg merge
- 3d 4h
- Merged PRs (30d)
- 172
Description
Description
When removing the last item in a list component (ScrollView/FlatList) with layout animations, I expect the list to animate and scroll to the new end of the list. Instead, the list simply jumps to the newly computed last end, resulting in a "glitchy" affect for the UX.
So far, I've been able to achieve the desired behavior with regular LayoutAnimations (see below). However, I'd like to switch to reanimated for this affect since LayoutAnimations is unreliable and often unintentionally affects other components.
This is a common usage pattern for paginated lists, especially when displaying loading indicators in the footer.
React Native's Layout Animation:
Snack: https://snack.expo.dev/@jcalem/layout-animation
Reanimated Layout Animation:
Snack: https://snack.expo.dev/@jcalem/layout-animation---reanimated
Steps to reproduce
- Open the snack
- Create a bunch of items that extend past the screen height
- Scroll to the last item and click to remove it
Snack or a link to a repository
https://snack.expo.dev/@jcalem/layout-animation---reanimated
Reanimated version
3.3.0
React Native version
0.71.3
Platforms
Android, iOS
JavaScript runtime
None
Workflow
Expo managed workflow
Architecture
None
Build type
None
Device
None
Device model
No response
Acknowledgements
Yes
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the Reanimated Layout Animation Snack and compare its last-item removal behavior with the regular React Native Layout Animation example. Trace the ScrollView/FlatList layout-animation handling, then verify that removing the final item animates to the new list end on Android and iOS.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react-native, typescript
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100