Fix VoiceOver focus staying in place after navigating
This commit is contained in:
parent
984ecc8879
commit
fccce078b2
|
@ -128,11 +128,13 @@ class BrowserNavigationController: UIViewController {
|
|||
|
||||
private func onNavigate(_ operation: NavigationManager.Operation) {
|
||||
let newVC: BrowserWebViewController
|
||||
var postAccessibilityNotification = false
|
||||
|
||||
switch operation {
|
||||
case .go:
|
||||
backBrowserVCs.append(currentBrowserVC)
|
||||
newVC = BrowserWebViewController(navigator: navigator, url: navigator.currentURL)
|
||||
postAccessibilityNotification = true
|
||||
|
||||
case .reload:
|
||||
currentBrowserVC.reload()
|
||||
|
@ -163,6 +165,10 @@ class BrowserNavigationController: UIViewController {
|
|||
self.toolbarOffset = 0
|
||||
}
|
||||
|
||||
if postAccessibilityNotification {
|
||||
// this moves focus to the nav bar, which isn't ideal, but it's better than nothing
|
||||
UIAccessibility.post(notification: .screenChanged, argument: nil)
|
||||
}
|
||||
}
|
||||
|
||||
private let startEdgeNavigationSwipeDistance: CGFloat = 75
|
||||
|
|
|
@ -151,6 +151,7 @@ class BrowserWebViewController: UIViewController {
|
|||
func reload() {
|
||||
loaded = false
|
||||
loadedFallback = false
|
||||
document = nil
|
||||
loadDocument()
|
||||
}
|
||||
|
||||
|
|
|
@ -39,6 +39,7 @@ class NavigationBarView: UIView {
|
|||
textField = UITextField()
|
||||
textField.text = navigator.displayURL
|
||||
textField.borderStyle = .roundedRect
|
||||
textField.textContentType = .URL
|
||||
textField.keyboardType = .URL
|
||||
textField.returnKeyType = .go
|
||||
textField.autocapitalizationType = .none
|
||||
|
|
Loading…
Reference in New Issue