JetBrains / compose-multiplatform

Compose Multiplatform, a modern UI framework for Kotlin that makes building performant and beautiful user interfaces easy and enjoyable.
https://jetbrains.com/lp/compose-multiplatform
Apache License 2.0
15.72k stars 1.14k forks source link

LazyVerticalStaggeredGrid rearranges items when scrolling up #5042

Closed rdsarna closed 2 weeks ago

rdsarna commented 1 month ago

Describe the bug Related to LazyVerticalStagggeredGrid. When the grid is in a scrolled down state and recreated due to returning from another screen, scrolling up causes the items to rearrange.

Affected platforms

Versions

To Reproduce

Steps to reproduce the behavior: Repository that exhibits the issue - https://github.com/rdsarna/KMP-App-Template This is a fork of a sample from the Kotlin Multiplatform Wizard. Commits added to recreate the issue - commit1 and commit2.

  1. Fresh install the app with an active internet connection (from the repo mentioned above)
  2. Scroll down quite a bit
  3. Tap on any item so the next screen opens
  4. Return back to the grid
  5. Slowly scroll up

Expected behavior The items should remain in place as user scroll up.

Screenshots Video for issue - https://youtube.com/shorts/369AA3R0XpQ

okushnikov commented 1 month ago

Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.

igordmn commented 2 weeks ago

See the comment there https://youtrack.jetbrains.com/issue/CMP-5042