From 41d695125e82f63949f5f4fb7c407708a34a3407 Mon Sep 17 00:00:00 2001 From: Nuo Xu Date: Mon, 27 Nov 2023 07:17:46 -0800 Subject: [PATCH] Fix #8445: View recovery phrases button is not tappable (#8473) --- .../Crypto/Onboarding/BackupWalletView.swift | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Sources/BraveWallet/Crypto/Onboarding/BackupWalletView.swift b/Sources/BraveWallet/Crypto/Onboarding/BackupWalletView.swift index d3ce39c23f2..7969d456385 100644 --- a/Sources/BraveWallet/Crypto/Onboarding/BackupWalletView.swift +++ b/Sources/BraveWallet/Crypto/Onboarding/BackupWalletView.swift @@ -34,6 +34,14 @@ struct BackupWalletView: View { // user can press return in field to execute when continue button is disabled return } + + // Dismiss keyboard for password field before leaving this view #8445. + // Without dismissal, it's possible the scroll view in the detail view + // has incorrect frame (sitting above the area the keyboard used to be) + // which can show the scroll view contents out of the scroll bounds + // but will block tap interactions. + resignFirstResponder() + keyringStore.recoveryPhrase(password: password) { words in if words.isEmpty { passwordError = .incorrectPassword @@ -42,6 +50,10 @@ struct BackupWalletView: View { } } } + + private func resignFirstResponder() { + UIApplication.shared.sendAction(#selector(UIResponder.resignFirstResponder), to: nil, from: nil, for: nil) + } var body: some View { ScrollView(.vertical) {