Skip to content

Commit

Permalink
revert: "fix: Emit scrolled event from onPreScroll"
Browse files Browse the repository at this point in the history
  • Loading branch information
null2264 committed Dec 31, 2024
1 parent 8a28d1d commit ac0d2e9
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,12 @@ private fun Modifier.drawScrollbar(
}
val nestedScrollConnection = remember(orientation, scrolled) {
object : NestedScrollConnection {
override fun onPreScroll(available: Offset, source: NestedScrollSource): Offset {
val delta = if (orientation == Orientation.Horizontal) available.x else available.y
override fun onPostScroll(
consumed: Offset,
available: Offset,
source: NestedScrollSource,
): Offset {
val delta = if (orientation == Orientation.Horizontal) consumed.x else consumed.y
if (delta != 0f) scrolled.tryEmit(Unit)
return Offset.Zero
}
Expand Down

0 comments on commit ac0d2e9

Please sign in to comment.