why doesnt LazyHorizontalGrid render in @Preview ?
# compose
u
why doesnt LazyHorizontalGrid render in @Preview ?
s
It should. If you got a minimal sample which reproduces this problem it is worth filing a report.
u
where do I file it ?
s
You go here https://issuetracker.google.com/issues/new?component=742043&template=1590761 And you try to pick the right component to file it against. You should also hopefully attach a project in which you are experiencing the broken behavior, along with which AS version you're using
u
okay I hve found the problem, it is wrapping the grid in Column - Removing the Column allows the preview to render: Code
Copy code
Column {
    LazyHorizontalGrid(
        rows = GridCells.Fixed(3),
        verticalArrangement = Arrangement.spacedBy(8.dp),
        horizontalArrangement = Arrangement.spacedBy(8.dp),
        modifier = Modifier.background(Color.White).padding(16.dp)
    ) {
        items(values) { item ->
            Column {
                Text(text = "item.first")
                Text(text = "item.first")
            }
        }
    }
}
s
Hmm, but does this render properly when running the app normally? I don't think this code has something which would make it render nothing 👀👀
a
Wrapping it a column should not break the preview