🛠️ 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) {
|
.pointerInput(Unit) {
|
||||||
detectHorizontalDragGestures(
|
detectHorizontalDragGestures(
|
||||||
onDragStart = { offset.floatValue = 0f },
|
onDragStart = { offset.floatValue = 0f },
|
||||||
|
onDragCancel = { offset.floatValue = 0f },
|
||||||
onDragEnd = {
|
onDragEnd = {
|
||||||
if (offset.floatValue.toDp() < (-60).dp) onDismissRequest()
|
if (offset.floatValue.toDp() < (-60).dp) onDismissRequest()
|
||||||
else offset.floatValue = 0f
|
else offset.floatValue = 0f
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,7 @@ fun Modifier.readerColorPresetChange(
|
||||||
Modifier.pointerInput(Unit) {
|
Modifier.pointerInput(Unit) {
|
||||||
detectHorizontalDragGestures(
|
detectHorizontalDragGestures(
|
||||||
onDragStart = { offset.floatValue = 0f },
|
onDragStart = { offset.floatValue = 0f },
|
||||||
|
onDragCancel = { offset.floatValue = 0f },
|
||||||
onDragEnd = {
|
onDragEnd = {
|
||||||
when {
|
when {
|
||||||
offset.floatValue > 200 -> {
|
offset.floatValue > 200 -> {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue