diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/feeds/RememberForeverStates.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/feeds/RememberForeverStates.kt index fbc6b5135..2cc7b942c 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/feeds/RememberForeverStates.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/feeds/RememberForeverStates.kt @@ -54,6 +54,8 @@ object ScrollStateKeys { const val DISCOVER_LIVE = "DiscoverLiveFeed" const val DISCOVER_COMMUNITY = "DiscoverCommunitiesFeed" const val DISCOVER_CHATS = "DiscoverChatsFeed" + + const val SEARCH_SCREEN = "SearchFeed" } object PagerStateKeys { diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/search/SearchScreen.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/search/SearchScreen.kt index 12ac914aa..acf6814c6 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/search/SearchScreen.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/search/SearchScreen.kt @@ -33,7 +33,8 @@ import androidx.compose.foundation.layout.statusBarsPadding import androidx.compose.foundation.lazy.LazyColumn import androidx.compose.foundation.lazy.LazyListState import androidx.compose.foundation.lazy.itemsIndexed -import androidx.compose.foundation.lazy.rememberLazyListState +import com.vitorpamplona.amethyst.ui.feeds.ScrollStateKeys +import com.vitorpamplona.amethyst.ui.feeds.rememberForeverLazyListState import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.foundation.text.KeyboardOptions import androidx.compose.material3.HorizontalDivider @@ -107,7 +108,7 @@ fun SearchScreen( ) { WatchLifecycleAndUpdateModel(searchBarViewModel) - val listState = rememberLazyListState() + val listState = rememberForeverLazyListState(ScrollStateKeys.SEARCH_SCREEN) LaunchedEffect(searchBarViewModel.focusRequester) { searchBarViewModel.focusRequester.requestFocus()