refactor: unify swipe reset to snap before clearing offset

Snap the Animatable first, clear rawOffset after - no frame with the
row still translated while the delete affordance is hidden.
This commit is contained in:
2026-09-04 13:28:27 +08:00
parent d892427a3f
commit 7b63ee4377
@@ -111,8 +111,8 @@ fun DictionaryListItem(
snapshotFlow { isDeleteBlockedCurrent() }
.collect { blocked ->
if (blocked) {
offsetAnim.snapTo(0f)
rawOffset = 0f
scope.launch { offsetAnim.snapTo(0f) }
}
}
}
@@ -271,8 +271,10 @@ fun DictionaryListItem(
onClick = {
haptic.performHapticFeedback(HapticFeedbackType.TextHandleMove)
currentOnDelete()
scope.launch { offsetAnim.snapTo(0f) }
scope.launch {
offsetAnim.snapTo(0f)
rawOffset = 0f
}
},
modifier = Modifier
.align(Alignment.CenterEnd)