Merge pull request 'fix(identity): stop a leaving surface from taking back' (#17) from fix/predictive-back-exit-gate into main

Reviewed-on: https://codeberg.org/jlmakiola/floret-kit/pulls/17
This commit is contained in:
Jean-Luc Makiola committed 2026-10-16 15:06:12 +02:00
commit 4858e00dfa
1 file changed
+3 -2
@@ -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