-
Hi 👋 For a few days, I've been investigating the approaches to somehow map multiple child stacks' back button handling into an Thanks for all the effort and active support! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Thanks for the question! Unfortunately, the If I understand your problem correctly, you want to be able to intercept the back button in components with (possibly) more than one stack. This may be useful to e.g. show a confirmation dialog before closing the screen. For this case, you can just register your own |
Beta Was this translation helpful? Give feedback.
-
Oh, I wasn't aware of such a history! Thanks for the context! fun onBack() {
if (stack2.value.backStack.isNotEmpty()) {
nav2.pop()
} else {
nav1.pop()
}
} My guess is, to mix the two, the Update: I'm starting to doubt that. Because, when the navigation gesture starts, the user can see what the end result would be, so the navigation would be already happening? This seems confusing. |
Beta Was this translation helpful? Give feedback.
I think it's not really possible to control multiple stacks by the predictive back gesture at the same time. If your component has more than one stack, then the predictive back gesture can only control only one of them. You write as follows.