Hey. We’ve come across an unexpected behavior in a...
# decompose
c
Hey. We’ve come across an unexpected behavior in an edge case. We’re using a bottom bar, and clicking on the tabs triggers the
bringToFront
function in RootComponent. If the user—_for some mysterious reason_—starts rapidly switching between tabs, the navigation can get stuck on one of the screens. When that happens, the screen becomes unresponsive to clicks. We share the RootComponent in android and iOS and it affects both. I also noticed the same issue in the sample Decompose app.
using a delay might be a quick fix but i wonder what the reason is
Copy code
private fun onTabClicked() {
        if (isSwitchingTabs) return
        isSwitchingTabs = true
        navigation.bringToFront(Config.A) {
            scope.launch {
                delay(100)
                isSwitchingTabs = false
            }
        }
    }
a
Hey! This looks like a bug. Might be related to either Compose or Decompose. You can also try the new experimental
ChildStack
Composable function from
extensions-compose-experimental
module.
c
I couldn't reproduce the issue when using
ChildStack
. Thank you!
a
Nice! Thanks for the report. I will try fixing it for the old Children function.
It would be nice if you file an issue on GitHub.
👍 1
1