Skip to content

Commit

Permalink
Fix brave/brave-ios#8445: View recovery phrases button is not tappable (
Browse files Browse the repository at this point in the history
  • Loading branch information
nuo-xu committed Nov 27, 2023
1 parent 675052f commit 6008911
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Sources/BraveWallet/Crypto/Onboarding/BackupWalletView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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) {
Expand Down

0 comments on commit 6008911

Please sign in to comment.