Hi there, is there a way to propagate a click even...
# compose
m
Hi there, is there a way to propagate a click event to a Composable with a z-index inferior to the current one ?
I have a composable that needs to slide over a
TopBar
. To do so, I decided to put the
Topbar
and the first content in a column with a z-index of 0 and the content that needs to slide over in a
LazyColumn
with a z-index of 1. Both columns take the full height. I decided to add an offset to the
LazyColumn
so the initial content would be visible. The only issue I have now is that the buttons of the
TopBar
composable don't intercept click events as the
LazyColumn
covers it. Any ideas how I could solve that ?
Copy code
Column(
    modifier = Modifier.zIndex(0f)
) {
    TopBar()
    Box(
        contentAlignment = Alignment.TopCenter,
        modifier = Modifier.fillMaxWidth().border(2.dp, Color.Red)
    ) {
        Image(
            painter = rememberGlidePainter(
                productImage,
                fadeIn = true
            ),
            contentDescription = "",
            modifier = Modifier.height(300.dp - 56.dp).border(2.dp, Color.Blue),
        )
    }


}
LazyColumn(
    modifier = Modifier.zIndex(1f)
) {
    item {
        Column(modifier = Modifier
            .offset(y = 300.dp)
            .background(Color.White)
            .fillMaxWidth()){
            Text(text = "coucou", color = Color.Black)
            Text(text = "coucou", color = Color.Black)
            Text(text = "coucou", color = Color.Black)
            Text(text = "coucou", color = Color.Black)
            Text(text = "coucou", color = Color.Black)
            Text(text = "coucou", color = Color.Black)
            Text(text = "coucou", color = Color.Black)
        }
    }
}