I've created a composable that has an higher zInde...
# compose
m
I've created a composable that has an higher zIndex than the other composables in the Box, so it's always visible but it doesn't receives click events. Is it a bug or my mistake?
Copy code
Box {
    // here doesn't reiceive clicks, but it's visible because it has an higher zindex
    HomeToolbar(title = currentBox.name, modifier = Modifier.preferredHeight(56.dp))
    VerticalScroller {
        Column {
            Spacer(modifier = Modifier.preferredHeight(56.dp))
            PokemonList(pokemon = pokemonPreviews.value) { slot ->
                state.selectedPokemonIndex = slot
            }
            Spacer(modifier = Modifier.preferredHeight(16.dp))
        }
    }
    // here it's both visible and reiceives clicks
    HomeToolbar(title = currentBox.name, modifier = Modifier.preferredHeight(56.dp))
}
a
do you use Modifier.zIndex? I don't see it in the code. if yes it is a bug, which we are aware of, thanks, we will fix it in the future releases, probably in dev12. for now you can try to use Stack, and instead of using Modifier.zIndex just change their order and apply the gravity modifier
👍 1
m
Yes, I've used Modifier.zIndex. Thank you for answering 😄