After tapping Paste button to paste privacy key for importing, Import button should be enabled #3030

pull/3033/head
Vladyslav shepitko 3 years ago
parent 5cd8f39671
commit 8c432ff773
  1. 6
      AlphaWallet/UI/Views/TextView.swift
  2. 6
      AlphaWallet/Wallet/ViewControllers/ImportWalletViewController.swift

@ -7,6 +7,7 @@ protocol TextViewDelegate: AnyObject {
func doneButtonTapped(for textView: TextView) func doneButtonTapped(for textView: TextView)
func nextButtonTapped(for textView: TextView) func nextButtonTapped(for textView: TextView)
func didChange(inTextView textView: TextView) func didChange(inTextView textView: TextView)
func didPaste(in textView: TextView)
} }
extension TextViewDelegate { extension TextViewDelegate {
@ -171,8 +172,9 @@ class TextView: UIControl {
} }
@objc func pasteAction() { @objc func pasteAction() {
if let value = UIPasteboard.general.string?.trimmed { if let pastedText = UIPasteboard.general.string?.trimmed {
self.value = value value = pastedText
delegate?.didPaste(in: self)
} }
} }

@ -660,6 +660,12 @@ extension ImportWalletViewController: TextFieldDelegate {
} }
extension ImportWalletViewController: TextViewDelegate { extension ImportWalletViewController: TextViewDelegate {
func didPaste(in textView: TextView) {
view.endEditing(true)
showCorrectTab()
}
func shouldReturn(in textView: TextView) -> Bool { func shouldReturn(in textView: TextView) -> Bool {
moveFocusToTextEntryField(after: textView) moveFocusToTextEntryField(after: textView)
return false return false

Loading…
Cancel
Save