Skip to content

Commit 8a28d1d

Browse files
committed
fix: Emit scrolled event from onPreScroll
1 parent 3399d6a commit 8a28d1d

File tree

1 file changed

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

1 file changed

+2
-6
lines changed

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

+2-6
Original file line numberDiff line numberDiff line change
@@ -166,12 +166,8 @@ private fun Modifier.drawScrollbar(
166166
}
167167
val nestedScrollConnection = remember(orientation, scrolled) {
168168
object : NestedScrollConnection {
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
169+
override fun onPreScroll(available: Offset, source: NestedScrollSource): Offset {
170+
val delta = if (orientation == Orientation.Horizontal) available.x else available.y
175171
if (delta != 0f) scrolled.tryEmit(Unit)
176172
return Offset.Zero
177173
}

0 commit comments

Comments
 (0)