Skip to content

Commit

Permalink
fix: swipe background issue
Browse files Browse the repository at this point in the history
  • Loading branch information
vishal2376 committed Mar 23, 2024
1 parent b0e0629 commit f6761ee
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ fun <T> SwipeActionBox(
content: @Composable (T) -> Unit
) {
var isActionDone by remember { mutableStateOf(false) }
val state = rememberDismissState(
val state = rememberDismissState(initialValue = DismissValue.Default,
confirmValueChange = { dismissValue ->
if (dismissValue == DismissValue.DismissedToStart) {
isActionDone = true
Expand All @@ -60,7 +60,7 @@ fun <T> SwipeActionBox(
if (isActionDone) {
delay(animationDuration.toLong())
onAction(item)
isActionDone = false
state.snapTo(DismissValue.Default)
}
}

Expand Down

0 comments on commit f6761ee

Please sign in to comment.