Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

List state issue while changing config #42

Open
DidarSeyidov opened this issue Sep 5, 2024 · 1 comment
Open

List state issue while changing config #42

DidarSeyidov opened this issue Sep 5, 2024 · 1 comment

Comments

@DidarSeyidov
Copy link

DidarSeyidov commented Sep 5, 2024

It is not preserve list state when changed screen configuration

@DidarSeyidov DidarSeyidov changed the title kotlin 2.0 support issue List state issue while changing config Sep 12, 2024
@vhaudiquet
Copy link

vhaudiquet commented Nov 18, 2024

@nanihadesuka

I have an issue that might be the same (even this one seems to be cryptic, feel free to move this elsewhere) :

when I use a listState that can be modified, e.g.

val listState = mutableStateOf(LazyListState())

@Composable
fun List() {
  LazyColumnScrollbar(
            state = listState.value,
            settings = ScrollbarSettings(alwaysShowScrollbar = true)
        ) {
            LazyColumn(
                state = listState.value,
            ) {
                 .....
            }
       }
}

then changing the listState (for a new one, with listState.value = LazyListState()) makes the scrollbar completely buggy
(unusable and showing randomly either position 0 or old liststate position).

without (alwaysShowScrollbar = true), the scrollbar just disappears completely

I think the issue is that LazyColumnScrollbar is not recomposed correctly, but LazyColumn is recomposed, so the states are desynchronized ? I could be wrong tho

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants