🛠️ Fix issues with pointerInput
* Fixed issues where pointerInput did not reset dragged composable position
This commit is contained in:
parent
8966951303
commit
181f1c94eb
2 changed files with 2 additions and 0 deletions
|
|
@ -113,6 +113,7 @@ fun ModalDrawer(
|
|||
.pointerInput(Unit) {
|
||||
detectHorizontalDragGestures(
|
||||
onDragStart = { offset.floatValue = 0f },
|
||||
onDragCancel = { offset.floatValue = 0f },
|
||||
onDragEnd = {
|
||||
if (offset.floatValue.toDp() < (-60).dp) onDismissRequest()
|
||||
else offset.floatValue = 0f
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ fun Modifier.readerColorPresetChange(
|
|||
Modifier.pointerInput(Unit) {
|
||||
detectHorizontalDragGestures(
|
||||
onDragStart = { offset.floatValue = 0f },
|
||||
onDragCancel = { offset.floatValue = 0f },
|
||||
onDragEnd = {
|
||||
when {
|
||||
offset.floatValue > 200 -> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue