File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed
flipchatApp/src/main/kotlin/xyz/flipchat/app/features/chat/list Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -133,7 +133,7 @@ private fun ChatListScreenContent(
133133 contentType = chats.itemContentType { " chat" }
134134 ) { index ->
135135 chats[index]?.let {
136- Column (modifier = Modifier .animateItemPlacement()) {
136+ Column {
137137 ChatNode (
138138 chat = it,
139139 onToggleMute = { mute ->
@@ -192,11 +192,15 @@ private fun ChatListScreenContent(
192192
193193 // opts out of the list maintaining
194194 // scroll position when adding elements before the first item
195+ // we are checking first visible item index to ensure
196+ // the list doesn't shift when scrolled
195197 Snapshot .withoutReadObservation {
196- listState.requestScrollToItem(
197- index = listState.firstVisibleItemIndex,
198- scrollOffset = listState.firstVisibleItemScrollOffset
199- )
198+ if (listState.firstVisibleItemIndex == 0 ) {
199+ listState.requestScrollToItem(
200+ index = listState.firstVisibleItemIndex,
201+ scrollOffset = listState.firstVisibleItemScrollOffset
202+ )
203+ }
200204 }
201205 }
202206 }
You can’t perform that action at this time.
0 commit comments