diff --git a/AlphaWallet/UI/Views/TextView.swift b/AlphaWallet/UI/Views/TextView.swift index 8fff09077..3522cab13 100644 --- a/AlphaWallet/UI/Views/TextView.swift +++ b/AlphaWallet/UI/Views/TextView.swift @@ -7,6 +7,7 @@ protocol TextViewDelegate: AnyObject { func doneButtonTapped(for textView: TextView) func nextButtonTapped(for textView: TextView) func didChange(inTextView textView: TextView) + func didPaste(in textView: TextView) } extension TextViewDelegate { @@ -171,8 +172,9 @@ class TextView: UIControl { } @objc func pasteAction() { - if let value = UIPasteboard.general.string?.trimmed { - self.value = value + if let pastedText = UIPasteboard.general.string?.trimmed { + value = pastedText + delegate?.didPaste(in: self) } } diff --git a/AlphaWallet/Wallet/ViewControllers/ImportWalletViewController.swift b/AlphaWallet/Wallet/ViewControllers/ImportWalletViewController.swift index 3a60433d9..c0c364d4d 100644 --- a/AlphaWallet/Wallet/ViewControllers/ImportWalletViewController.swift +++ b/AlphaWallet/Wallet/ViewControllers/ImportWalletViewController.swift @@ -660,6 +660,12 @@ extension ImportWalletViewController: TextFieldDelegate { } extension ImportWalletViewController: TextViewDelegate { + + func didPaste(in textView: TextView) { + view.endEditing(true) + showCorrectTab() + } + func shouldReturn(in textView: TextView) -> Bool { moveFocusToTextEntryField(after: textView) return false