From 55e6bbb4b3ba3a01c5ee05525e2cca1d1cfeff6c Mon Sep 17 00:00:00 2001 From: Nuo Xu Date: Thu, 23 Nov 2023 16:20:51 -0500 Subject: [PATCH 1/2] fix view recovery phrases button is not tappable --- .../BraveWallet/Crypto/Onboarding/BackupWalletView.swift | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Sources/BraveWallet/Crypto/Onboarding/BackupWalletView.swift b/Sources/BraveWallet/Crypto/Onboarding/BackupWalletView.swift index d3ce39c23f2..3eb0e1da1ae 100644 --- a/Sources/BraveWallet/Crypto/Onboarding/BackupWalletView.swift +++ b/Sources/BraveWallet/Crypto/Onboarding/BackupWalletView.swift @@ -34,6 +34,11 @@ struct BackupWalletView: View { // user can press return in field to execute when continue button is disabled return } + + // password filed resign first responder in case ScrollView gets changed + // which could effect the next step. Details see #8445 + resignFirstResponder() + keyringStore.recoveryPhrase(password: password) { words in if words.isEmpty { passwordError = .incorrectPassword @@ -42,6 +47,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) { From 2282ceb8e91adcc08019e0b6182307b7f02614ac Mon Sep 17 00:00:00 2001 From: Nuo Xu Date: Fri, 24 Nov 2023 07:25:00 -0500 Subject: [PATCH 2/2] code review suggestion --- .../BraveWallet/Crypto/Onboarding/BackupWalletView.swift | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Sources/BraveWallet/Crypto/Onboarding/BackupWalletView.swift b/Sources/BraveWallet/Crypto/Onboarding/BackupWalletView.swift index 3eb0e1da1ae..7969d456385 100644 --- a/Sources/BraveWallet/Crypto/Onboarding/BackupWalletView.swift +++ b/Sources/BraveWallet/Crypto/Onboarding/BackupWalletView.swift @@ -35,8 +35,11 @@ struct BackupWalletView: View { return } - // password filed resign first responder in case ScrollView gets changed - // which could effect the next step. Details see #8445 + // 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