Fix scroll issues in suggestion list

Before if the list before updating contained item 'test' at position 0 and after updating that value went to the bottom, the list would incorrectly scroll to the bottom to follow that item. Now the scrolling is done after the list is updated.
pull/8972/head
Stypox 2022-09-14 14:39:32 +02:00
rodzic 1f57c87859
commit 28b34f3796
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4BDF1B40A49FDD23
1 zmienionych plików z 2 dodań i 2 usunięć

Wyświetl plik

@ -946,8 +946,8 @@ public class SearchFragment extends BaseListFragment<SearchInfo, ListExtractor.I
if (DEBUG) {
Log.d(TAG, "handleSuggestions() called with: suggestions = [" + suggestions + "]");
}
searchBinding.suggestionsList.smoothScrollToPosition(0);
suggestionListAdapter.submitList(suggestions);
suggestionListAdapter.submitList(suggestions,
() -> searchBinding.suggestionsList.scrollToPosition(0));
if (suggestionsPanelVisible && isErrorPanelVisible()) {
hideLoading();