Has anyone encountered this strange preview behavi...
# compose
e
Has anyone encountered this strange preview behavior? It seems like the 1st preview is more "live" than any following previews. If there are any side effects or height calculations involved, the other previews are showing up incorrectly (unless I open them in interactive mode). Code example in thread:
yes black 3
Copy code
@Composable
private fun TestingOffsets(modifier: Modifier = Modifier) {
    var offset by remember { mutableFloatStateOf(0f) }
    Text(
        "Current offset -> $offset",
        modifier =
            modifier.onGloballyPositioned { coordinates ->
                offset = coordinates.size.height.toFloat()
            },
    )
}

@Preview(showBackground = true)
@Composable
private fun Preview() {
    TestingOffsets()
}

@Preview(showBackground = true)
@Composable
private fun PreviewTwo() {
    TestingOffsets()
}

@Preview(showBackground = true)
@Composable
private fun PreviewThree() {
    TestingOffsets()
}
image.png