saket/swipe

Crash when swiped to full width

alashow opened this issue · 2 comments

Crash happens when swiping/dragging content to it's full width.

Stacktrace:

java.lang.IllegalStateException: Couldn't find any swipe action. Width=1160, offset=1162.4507, actions=[me.saket.swipe.SwipeAction@c737efb, me.saket.swipe.SwipeAction@effbb18]
 	at me.saket.swipe.ActionFinder.actionAt(ActionFinder.kt:49)
 	at me.saket.swipe.ActionFinder.actionAt(ActionFinder.kt:24)
 	at me.saket.swipe.SwipeableActionsBoxKt$SwipeableActionsBox$1.invoke(SwipeableActionsBox.kt:82)
 	at me.saket.swipe.SwipeableActionsBoxKt$SwipeableActionsBox$1.invoke(SwipeableActionsBox.kt:56)
 	at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:116)

Screenrecord: https://kapture-4t6s5u7zc-alashov.vercel.app

This can be fixed by returning the last action like this:

error("Couldn't find any swipe action. Width=$totalWidth, offset=$offset, actions=$this")

image

How it looks: https://i.imgur.com/XLYdlNg.gif

saket commented

Fixed, thanks for reporting!