Some main menu fixes
This commit is contained in:
@@ -496,6 +496,25 @@ class BrowserViewController: UIViewController
|
||||
toolbarController.urlBar.textField.resignFirstResponder()
|
||||
}
|
||||
|
||||
override func target(forAction action: Selector, withSender sender: Any?) -> Any? {
|
||||
var findActions: [Selector] = []
|
||||
if #available(macCatalyst 16.0, *) {
|
||||
findActions = [
|
||||
#selector(UIResponder.find(_:)),
|
||||
#selector(UIResponder.findNext(_:)),
|
||||
#selector(UIResponder.findPrevious(_:)),
|
||||
#selector(UIResponder.findAndReplace(_:)),
|
||||
#selector(UIResponder.useSelectionForFind(_:)),
|
||||
]
|
||||
}
|
||||
|
||||
if findActions.contains(where: { $0 == action }) {
|
||||
return webView.target(forAction: action, withSender: sender)
|
||||
}
|
||||
|
||||
return super.target(forAction: action, withSender: sender)
|
||||
}
|
||||
|
||||
override func viewWillAppear(_ animated: Bool) {
|
||||
super.viewWillAppear(animated)
|
||||
becomeFirstResponder()
|
||||
|
||||
Reference in New Issue
Block a user