Fix find and replace

This commit is contained in:
James Magahern
2023-01-11 13:20:36 -08:00
parent 12e2d82009
commit 836daee5a3

View File

@@ -265,13 +265,15 @@ class BrowserViewController: UIViewController
// Find on page
documentControls.findOnPageControlView.addAction(UIAction(handler: { [unowned self] _ in
documentControls.dismiss(animated: true, completion: nil)
if FindOnPageViewController.isEnabled() {
browserView.setFindOnPageVisible(true, animated: true)
} else if #available(iOS 16.0, *) {
browserView.webView?.findInteraction?.presentFindNavigator(showingReplace: false)
}
documentControls.dismiss(animated: true, completion: { [unowned self] in
// Needs to happen after dismissal, otherwise the find navigator will pick up the document
// controls as the divergent responder/deepest action responder (my bad...).
if FindOnPageViewController.isEnabled() {
browserView.setFindOnPageVisible(true, animated: true)
} else if #available(iOS 16.0, *) {
browserView.webView?.findInteraction?.presentFindNavigator(showingReplace: false)
}
})
}), for: .touchUpInside)
// Navigation controls