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.29k stars 1.12k forks source link

LazyListState.animateScrollToItem Not scrolling correctly to the specified index #4148

Open ltttttttttttt opened 5 months ago

ltttttttttttt commented 5 months ago

Describe the bug LazyListState.animateScrollToItem Not scrolling correctly to the specified index

Affected platforms Select one of the platforms below:

Versions

To Reproduce Steps and/or the code snippet to reproduce the behavior:

  1. run iosApp in https://github.com/ltttttttttttt/ComposeViews
  2. Click on 'ValueSelector功能'
  3. Dragging the Value selector control at the top and dragging it down to the bottom of the screen will trigger scrolling to the corresponding index, but there is no animation
  4. Code in https://github.com/ltttttttttttt/ComposeViews/blob/main/ComposeViews/src/commonMain/kotlin/com/lt/compose_views/value_selector/ValueSelector.kt line:133

Expected behavior I hope to scroll to the corresponding index like Android

Screenshots

image
elijah-semyonov commented 5 months ago

I didn't manage to compile it. Can you provide a minimal snippet reproducing the problem?

ltttttttttttt commented 5 months ago

I didn't manage to compile it. Can you provide a minimal snippet reproducing the problem?

run iosApp https://github.com/ltttttttttttt/ComposeViews/tree/LazyListState-bug/chat

line 73 https://github.com/ltttttttttttt/ComposeViews/blob/LazyListState-bug/chat/shared/src/commonMain/kotlin/ChatApp.kt

mazunin-v-jb commented 4 months ago

Hello, @ltttttttttttt! Unfortunately, your project contains a significant amount of user-specific code and details. We can't accept that as reproducer because we can't be sure that the issue is on our side.

Could you please provide a stripped down version of your code that demonstrates the issue?