mirror of
https://github.com/null2264/yokai.git
synced 2025-06-21 02:34:39 +00:00
revert: "fix: Emit scrolled event from onPreScroll"
This commit is contained in:
parent
8a28d1d484
commit
ac0d2e9fc0
1 changed files with 6 additions and 2 deletions
|
@ -166,8 +166,12 @@ private fun Modifier.drawScrollbar(
|
||||||
}
|
}
|
||||||
val nestedScrollConnection = remember(orientation, scrolled) {
|
val nestedScrollConnection = remember(orientation, scrolled) {
|
||||||
object : NestedScrollConnection {
|
object : NestedScrollConnection {
|
||||||
override fun onPreScroll(available: Offset, source: NestedScrollSource): Offset {
|
override fun onPostScroll(
|
||||||
val delta = if (orientation == Orientation.Horizontal) available.x else available.y
|
consumed: Offset,
|
||||||
|
available: Offset,
|
||||||
|
source: NestedScrollSource,
|
||||||
|
): Offset {
|
||||||
|
val delta = if (orientation == Orientation.Horizontal) consumed.x else consumed.y
|
||||||
if (delta != 0f) scrolled.tryEmit(Unit)
|
if (delta != 0f) scrolled.tryEmit(Unit)
|
||||||
return Offset.Zero
|
return Offset.Zero
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue