From b322e4c19b4c899b10b6392665091bfe25e59d6c Mon Sep 17 00:00:00 2001 From: Grigory Kruglov Date: Tue, 11 Jan 2022 17:27:14 -0800 Subject: [PATCH] [fenix] Scroll to top of logins screen after list changes --- .../fenix/settings/logins/view/SavedLoginsListView.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/org/mozilla/fenix/settings/logins/view/SavedLoginsListView.kt b/app/src/main/java/org/mozilla/fenix/settings/logins/view/SavedLoginsListView.kt index 69f73265f5..2d6f515573 100644 --- a/app/src/main/java/org/mozilla/fenix/settings/logins/view/SavedLoginsListView.kt +++ b/app/src/main/java/org/mozilla/fenix/settings/logins/view/SavedLoginsListView.kt @@ -62,6 +62,9 @@ class SavedLoginsListView( binding.savedLoginsList.isVisible = state.loginList.isNotEmpty() binding.savedPasswordsEmptyView.isVisible = state.loginList.isEmpty() } - loginsAdapter.submitList(state.filteredItems) + loginsAdapter.submitList(state.filteredItems) { + // Reset scroll position to the first item after submitted list was committed. + binding.savedLoginsList.scrollToPosition(0) + } } }