https://kotlinlang.org logo
#compose
Title
# compose
s

Sergey B

12/12/2023, 12:33 PM
Hi, I use navigation-compose and compose.ui (version 1.6.0-beta02). I see some weird behaviour of LazyColumn when it's inside NavHost. This reproducible in release builds but not in debug. See code examples and video in the thread 🧵
Copy code
setContent {
            val controller = rememberNavController()

            MyTheme {
                NavHost(
                    navController = controller,
                    startDestination = HOME_ROUTE,
                ) {
                    composable(HOME_ROUTE) {
                        LazyColumn {
                            items((0..1000).toList()) {
                                ListItem(
                                    modifier = Modifier.animateItemPlacement(),
                                    headlineContent = {
                                        Text(text = "Hello $it")
                                    }
                                )
                            }
                        }
                    }
                }
            }
        }
Here is code sample that causes the issue
Copy code
setContent {
            MyTheme {
                LazyColumn {
                    items((0..1000).toList()) {
                        ListItem(
                            modifier = Modifier.animateItemPlacement(),
                            headlineContent = {
                                Text(text = "Hello $it")
                            }
                        )
                    }
                }
            }
        }
And this one works well
screen-20231212-143454.mp4
just interesting is known bug or should I file a bug?
a

Andrey Kulikov

12/12/2023, 12:55 PM
it is a known issue, will be fixed in the next beta
👍 1
s

Sergey B

12/12/2023, 1:01 PM
thank you
2 Views