Only scrolls to the top if not at the top
This commit is contained in:
@@ -104,9 +104,11 @@ private fun FeedLoaded(
|
|||||||
|
|
||||||
if (scrollToTop) {
|
if (scrollToTop) {
|
||||||
LaunchedEffect(Unit) {
|
LaunchedEffect(Unit) {
|
||||||
|
if (listState.firstVisibleItemIndex > 0 || listState.firstVisibleItemScrollOffset > 0) {
|
||||||
listState.scrollToItem(index = 0)
|
listState.scrollToItem(index = 0)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
LazyColumn(
|
LazyColumn(
|
||||||
contentPadding = PaddingValues(
|
contentPadding = PaddingValues(
|
||||||
|
|||||||
@@ -119,9 +119,11 @@ private fun FeedLoaded(
|
|||||||
|
|
||||||
if (scrollToTop) {
|
if (scrollToTop) {
|
||||||
LaunchedEffect(Unit) {
|
LaunchedEffect(Unit) {
|
||||||
|
if (listState.firstVisibleItemIndex > 0 || listState.firstVisibleItemScrollOffset > 0) {
|
||||||
listState.scrollToItem(index = 0)
|
listState.scrollToItem(index = 0)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
val baseModifier = remember {
|
val baseModifier = remember {
|
||||||
Modifier
|
Modifier
|
||||||
|
|||||||
Reference in New Issue
Block a user