mirror of
https://github.com/null2264/yokai.git
synced 2025-06-20 18:24:42 +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) {
|
||||
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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue