I’m having a `LazyColumn` that should be always s...
# compose
c
I’m having a
LazyColumn
that should be always scrolled to the bottom (chat style list) I do that with
Copy code
LaunchedEffect(listState.items) { scrollState....}
problem is that i have a list item that changes it’s size depending on an interaction this change is not picked up, bc. the items list itself is not altered. don’t want to expose the in-memory state if the item to the list so i could listen to it on list-level. is there any other way apart from providing a scrollToBottom callback down to the item - that it can call when it’s size changes?
c
LazyColumn() { }
has a
reverseLayout
parameter for exactly this purpose
m
If i'm understanding your question correctly, your list of items doesn't change, just some piece of data within the item. Compose, of course will never pick up on that, because you're not re-assigning the value of some mutable state object. I would recommend having immutable data in your list, and updating the list as as a whole when the state changes.
c
i can’t use reverseLayout as I also need to query the visible list items for displaying sticky headers (can’t use the platform provided ones) yes, i fear i need to re-architect a bit here. thanks for the responses