WheelPickerCompose icon indicating copy to clipboard operation
WheelPickerCompose copied to clipboard

Bounces back when it fling or drag to the bottom

Open EchoDongYu opened this issue 1 year ago • 1 comments

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 avatar Apr 17 '24 10:04 EchoDongYu

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

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

EchoDongYu avatar Apr 18 '24 03:04 EchoDongYu