For #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.
upstream-sync
Geordan Neukum 2 years ago committed by mergify[bot]
parent 2dc95366bf
commit 6b78fa3295

@ -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(

Loading…
Cancel
Save