Fix keyboard not being dismissed in some circumstances
This commit is contained in:
parent
040a799b7b
commit
e27ac15635
|
@ -34,6 +34,10 @@ class BrowserNavigationController: UIViewController {
|
|||
|
||||
if (oldValue <= 0.5 && toolbarOffset > 0.5) || (oldValue > 0.5 && toolbarOffset <= 0.5) {
|
||||
setNeedsStatusBarAppearanceUpdate()
|
||||
|
||||
if navBarView.textField.isFirstResponder {
|
||||
navBarView.textField.resignFirstResponder()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -205,6 +209,10 @@ class BrowserNavigationController: UIViewController {
|
|||
if position == .end {
|
||||
self.navigator.goBack()
|
||||
}
|
||||
|
||||
if self.navBarView.textField.isFirstResponder {
|
||||
self.navBarView.textField.resignFirstResponder()
|
||||
}
|
||||
}
|
||||
gestureState = .backwards(animator)
|
||||
} else if location.x > view.bounds.width - startEdgeNavigationSwipeDistance && velocity.x < 0 && navigator.forwardStack.count > 0 {
|
||||
|
@ -236,6 +244,10 @@ class BrowserNavigationController: UIViewController {
|
|||
if position == .end {
|
||||
self.navigator.goForward()
|
||||
}
|
||||
|
||||
if self.navBarView.textField.isFirstResponder {
|
||||
self.navBarView.textField.resignFirstResponder()
|
||||
}
|
||||
}
|
||||
gestureState = .forwards(animator)
|
||||
}
|
||||
|
|
|
@ -81,6 +81,7 @@ class BrowserWebViewController: UIViewController {
|
|||
webView.scrollView.delegate = scrollViewDelegate
|
||||
// this doesn't default to .default :S
|
||||
webView.scrollView.indicatorStyle = .default
|
||||
webView.scrollView.keyboardDismissMode = .interactive
|
||||
webView.translatesAutoresizingMaskIntoConstraints = false
|
||||
view.addSubview(webView)
|
||||
NSLayoutConstraint.activate([
|
||||
|
|
Loading…
Reference in New Issue