From 7a57194a4857b273c79eac614083097d7511e512 Mon Sep 17 00:00:00 2001 From: Geordan Neukum Date: Thu, 3 Feb 2022 22:11:50 -0500 Subject: [PATCH] [fenix] For https://github.com/mozilla-mobile/fenix/issues/23500: creditcards: hide keyboard when pausing fragment Right now, the soft keyboard will remain open when we exit the "Add Card" screen. Let's make it so that the soft keyboard is automatically closed when leaving this screen. --- .../fenix/settings/creditcards/CreditCardEditorFragment.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/org/mozilla/fenix/settings/creditcards/CreditCardEditorFragment.kt b/app/src/main/java/org/mozilla/fenix/settings/creditcards/CreditCardEditorFragment.kt index 34592095fa..053a6e5414 100644 --- a/app/src/main/java/org/mozilla/fenix/settings/creditcards/CreditCardEditorFragment.kt +++ b/app/src/main/java/org/mozilla/fenix/settings/creditcards/CreditCardEditorFragment.kt @@ -15,6 +15,7 @@ import androidx.navigation.fragment.navArgs import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch import kotlinx.coroutines.withContext +import mozilla.components.support.ktx.android.view.hideKeyboard import org.mozilla.fenix.R import org.mozilla.fenix.SecureFragment import org.mozilla.fenix.databinding.FragmentCreditCardEditorBinding @@ -82,10 +83,11 @@ class CreditCardEditorFragment : SecureFragment(R.layout.fragment_credit_card_ed } /** - * Close any open dialogs or menus and reauthenticate if the fragment is paused and - * the user is not navigating to [CreditCardsManagementFragment]. + * Close the keyboard, any open dialogs or menus and then reauthenticate if the + * fragment is paused and the user is not navigating to [CreditCardsManagementFragment]. */ override fun onPause() { + view?.hideKeyboard() menu.close() redirectToReAuth(