diff --git a/Gemini-iOS/NavigationBarView.swift b/Gemini-iOS/NavigationBarView.swift index 8e6c2e5..9985b44 100644 --- a/Gemini-iOS/NavigationBarView.swift +++ b/Gemini-iOS/NavigationBarView.swift @@ -14,7 +14,7 @@ class NavigationBarView: UIView { let navigator: NavigationManager private var border: UIView! - private var textField: UITextField! + private(set) var textField: UITextField! private var cancellables = [AnyCancellable]() @@ -40,9 +40,10 @@ class NavigationBarView: UIView { textField.text = navigator.displayURL textField.borderStyle = .roundedRect textField.keyboardType = .URL + textField.returnKeyType = .go textField.autocapitalizationType = .none textField.autocorrectionType = .no - textField.addTarget(self, action: #selector(commitURL), for: .editingDidEnd) + textField.addTarget(self, action: #selector(commitURL), for: .primaryActionTriggered) textField.translatesAutoresizingMaskIntoConstraints = false addSubview(textField) NSLayoutConstraint.activate([ @@ -75,6 +76,7 @@ class NavigationBarView: UIView { } @objc private func commitURL() { + textField.resignFirstResponder() if let text = textField.text, let url = URL(string: text) { navigator.changeURL(url) } else {