I'm using a LazyColumn to display a list of videos...
# compose
z
I'm using a LazyColumn to display a list of videos but it loses its scroll position when navigating away from it to another screen. If i remove the loading indicator item then it remembers the scroll position properly
Copy code
LazyColumn(
        modifier = Modifier
            .fillMaxSize()
            .padding(horizontal = 14.dp),
        horizontalAlignment = Alignment.CenterHorizontally,
        verticalArrangement = Arrangement.spacedBy(8.dp)
    ) {
        items(videoListItems) { video ->
            if (video == null) return@items

            VideoCard(
                video = video,
                onClick = { onClickVideo(video.id) },
                onClickChannel = { onClickChannel(video.author!!.id) }
            )
        }

        item {
            videoListItems.loadState.apply {
                when (append) {
                    is LoadState.Loading -> {
                        CircularProgressIndicator(modifier = Modifier.padding(4.dp))
                    }
                    is LoadState.Error -> {
                        (append as LoadState.Error).error.printStackTrace()

                        Text("An error has occurred")
                    }
                    else -> Unit
                }
            }
        }
    }
i
z
Still no proper solution to this problem?
@Ian Lake