Skip to content
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

Bounces back when it fling or drag to the bottom #51

Open
EchoDongYu opened this issue Apr 17, 2024 · 1 comment
Open

Bounces back when it fling or drag to the bottom #51

EchoDongYu opened this issue Apr 17, 2024 · 1 comment

Comments

@EchoDongYu
Copy link

There is something wrong with the flingBehavior when use in Dialog or ModalBottomSheet,It will bounces back when it fling or drag to the bottom
动画

@EchoDongYu
Copy link
Author

EchoDongYu commented Apr 18, 2024

问题在于 onScrollFinished 中的 snappedIndex 可能会越界,如下替换可解决问题

  val newDayOfMonth =
      if (snappedIndex >= dayOfMonths.size) dayOfMonths.last().value
      else dayOfMonths.find { it.index == snappedIndex }?.value

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant