PreCompose icon indicating copy to clipboard operation
PreCompose copied to clipboard

Scenes freezing when quickly switching routes with transitions

Open StarsEnd33A2D17 opened this issue 1 year ago • 11 comments

The issue of scenes freezing when quickly switching routes still persists in version 1.6.0-beta02, possibly due to animation-related issues.

Example:

LaunchedEffect(Unit){
                    coroutineScope.launch {
                        for (i in 0 until 10){
                            println(i)
                            navigator.navigate("/edit")
                            delay(200)
                            navigator.navigate("/home")
                            delay(200)
                        }
                    }
                }

When using with the default animation, after 1 to 3 transitions, it will stop navigating and remain frozen indefinitely, while all interactions except routing work normally, and any route changes will not affect the actual content.

After modifying the transitions:

navTransition = NavTransition(
                            createTransition = EnterTransition.None,
                            destroyTransition = ExitTransition.None,
                            pauseTransition = ExitTransition.None,
                            resumeTransition = EnterTransition.None,
                        )

Then it works great.

StarsEnd33A2D17 avatar Feb 10 '24 18:02 StarsEnd33A2D17