mirror of
https://github.com/aniyomiorg/aniyomi.git
synced 2024-11-26 06:43:45 +03:00
Fix checkboxes not working after scrolling in filter sheet (#10023)
Fixed an issue where CheckBox was not being checked after scrolling in the Filter tab
This commit is contained in:
parent
f79f0a7e97
commit
2bf77f1d81
1 changed files with 11 additions and 3 deletions
|
@ -167,7 +167,10 @@ fun AdaptiveSheet(
|
|||
.offset {
|
||||
IntOffset(
|
||||
0,
|
||||
anchoredDraggableState.offset.takeIf { it.isFinite() }?.roundToInt() ?: 0,
|
||||
anchoredDraggableState.offset
|
||||
.takeIf { it.isFinite() }
|
||||
?.roundToInt()
|
||||
?: 0,
|
||||
)
|
||||
}
|
||||
.anchoredDraggable(
|
||||
|
@ -238,8 +241,13 @@ private fun <T> AnchoredDraggableState<T>.preUpPostDownNestedScrollConnection()
|
|||
}
|
||||
|
||||
override suspend fun onPostFling(consumed: Velocity, available: Velocity): Velocity {
|
||||
settle(velocity = available.toFloat())
|
||||
return available
|
||||
val toFling = available.toFloat()
|
||||
return if (toFling > 0) {
|
||||
settle(toFling)
|
||||
available
|
||||
} else {
|
||||
Velocity.Zero
|
||||
}
|
||||
}
|
||||
|
||||
private fun Float.toOffset(): Offset = Offset(0f, this)
|
||||
|
|
Loading…
Reference in a new issue