Skip to content

Priority of back callbacks on children of components with +1 stacks? #512

Answered by arkivanov
YektaDev asked this question in Q&A
Discussion options

You must be logged in to vote

There should be no difference in back handling depending on the platform, as all the code is multiplatform. Assuming you drive the root lifecycle on desktop (e.g. by using LifecycleController). Also it's not clear how do you trigger the back button on desktop?

The logic is pretty simple.

Each Child Stack registers two back callbacks when childStack function is called. One callback with priority equal to PRIORITY_DEFAULT + 1 for the currently active child component, and another callback with priority equal to PRIORITY_DEFAULT for the stack itself. The former callback allows the active component to intercept the back button. This callbacks is only enabled when there is an inner enabled call…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by YektaDev
Comment options

You must be logged in to vote
1 reply
@arkivanov
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants