Skip to content

Commit ac0d2e9

Browse files
committed
revert: "fix: Emit scrolled event from onPreScroll"
1 parent 8a28d1d commit ac0d2e9

File tree

1 file changed

+6
-2
lines changed
  • presentation/core/src/main/java/yokai/presentation/core

1 file changed

+6
-2
lines changed

presentation/core/src/main/java/yokai/presentation/core/Scrollbar.kt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,12 @@ private fun Modifier.drawScrollbar(
166166
}
167167
val nestedScrollConnection = remember(orientation, scrolled) {
168168
object : NestedScrollConnection {
169-
override fun onPreScroll(available: Offset, source: NestedScrollSource): Offset {
170-
val delta = if (orientation == Orientation.Horizontal) available.x else available.y
169+
override fun onPostScroll(
170+
consumed: Offset,
171+
available: Offset,
172+
source: NestedScrollSource,
173+
): Offset {
174+
val delta = if (orientation == Orientation.Horizontal) consumed.x else consumed.y
171175
if (delta != 0f) scrolled.tryEmit(Unit)
172176
return Offset.Zero
173177
}

0 commit comments

Comments
 (0)