diff --git a/identity/src/main/kotlin/de/jeanlucmakiola/floret/identity/Motion.kt b/identity/src/main/kotlin/de/jeanlucmakiola/floret/identity/Motion.kt index b91a0a7..c7ae13e 100644 --- a/identity/src/main/kotlin/de/jeanlucmakiola/floret/identity/Motion.kt +++ b/identity/src/main/kotlin/de/jeanlucmakiola/floret/identity/Motion.kt @@ -87,7 +87,8 @@ fun Modifier.animateContentSizeMotion(reduceMotion: Boolean = rememberReduceMoti * the surface leaves and dropped the moment it is shown again, so reopening it * mid-exit never starts from the shrunk state; a back that leaves it visible * settles back. Null when the caller doesn't track it: the preview is then held - * for a fixed time before settling back. + * for a fixed time before settling back. A surface that is leaving no longer + * takes back, so a second press reaches the screen underneath. */ @Composable fun Modifier.predictiveBack( @@ -104,7 +105,7 @@ fun Modifier.predictiveBack( if (visible == true) progress.snapTo(0f) } - PredictiveBackHandler(enabled = enabled) { events -> + PredictiveBackHandler(enabled = enabled && visible != false) { events -> try { events.collect { event -> fromLeftEdge = event.swipeEdge == BackEventCompat.EDGE_LEFT