-
Notifications
You must be signed in to change notification settings - Fork 305
[Bug] Jarring layout shifts for each item using LayoutAnimation w/ inverted list #1596
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I did manage to improve this by removing this line which was causing issues (transitions between two padding values, causing rest to shift): isSameNextSender ? 'pb-1' : 'pb-3.5', Improved the animation config a bit: LayoutAnimation.configureNext({
duration: 500,
create: { type: 'linear', property: 'opacity' },
update: { type: 'spring', springDamping: 10 },
delete: { type: 'linear', property: 'opacity' },
}) But still one item (either most recent from the opposite sender, or two-line message, not sure) is jumping down first. Simulator.Screen.Recording.-.iPhone.16.Pro.Max.-.2025-04-02.at.14.24.16.mp4I pushed a new commit to the repo linked above with these changes. |
Yeah OK narrowed it down to the issue. Items that are of a different size/larger than the rest are causing issues. If all the messages are one line, it works as intended, if there is even one that's two lines (and a thus larger height for that list element) we get jumps: Simulator.Screen.Recording.-.iPhone.16.Pro.Max.-.2025-04-02.at.14.41.55.mp4 |
I am also using this component to make IM chat pages, but my layout is much more complicated than yours, I also have voice messages, picture messages, video messages, etc. The height is all uncertain. |
I don't understand the reply here @zrina1314. Is it working for you with the layout transitions, or you're having the same issue as me? |
My app is similar to this one and has encountered the same problem as yours. I'm now looking forward to the official release of V2 and directly switch to V2 version |
Current behavior
When new items are added to the list (inverted, so they get added at the bottom), every item jumps from its position first down, then slides up slowly to meet its final position.
Video:
Simulator.Screen.Recording.-.iPhone.16.Pro.Max.-.2025-04-02.at.12.27.23.mp4
Expected behavior
When a new item is added, they should slowly shift up from their current layout position to their final layout position without any "jumps"
To Reproduce
Full minimal repro is here:
https://github.com/kevinschaich/flash-list-layout-bug
Relevant code:
Platform:
Environment
1.8.0
The text was updated successfully, but these errors were encountered: