Ignore key commands when the web view has focus. Fixes #3179
This commit is contained in:
parent
321e61b635
commit
86ca397221
iOS
@ -35,6 +35,12 @@ class MasterFeedViewController: UITableViewController, UndoableCommandRunner {
|
|||||||
|
|
||||||
private let keyboardManager = KeyboardManager(type: .sidebar)
|
private let keyboardManager = KeyboardManager(type: .sidebar)
|
||||||
override var keyCommands: [UIKeyCommand]? {
|
override var keyCommands: [UIKeyCommand]? {
|
||||||
|
|
||||||
|
// If the first responder is the WKWebView (PreloadedWebView) we don't want to supply any keyboard
|
||||||
|
// commands that the system is looking for by going up the responder chain. They will interfere with
|
||||||
|
// the WKWebViews built in hardware keyboard shortcuts, specifically the up and down arrow keys.
|
||||||
|
guard let current = UIResponder.currentFirstResponder, !(current is PreloadedWebView) else { return nil }
|
||||||
|
|
||||||
return keyboardManager.keyCommands
|
return keyboardManager.keyCommands
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -33,6 +33,12 @@ class MasterTimelineViewController: UITableViewController, UndoableCommandRunner
|
|||||||
|
|
||||||
private let keyboardManager = KeyboardManager(type: .timeline)
|
private let keyboardManager = KeyboardManager(type: .timeline)
|
||||||
override var keyCommands: [UIKeyCommand]? {
|
override var keyCommands: [UIKeyCommand]? {
|
||||||
|
|
||||||
|
// If the first responder is the WKWebView (PreloadedWebView) we don't want to supply any keyboard
|
||||||
|
// commands that the system is looking for by going up the responder chain. They will interfere with
|
||||||
|
// the WKWebViews built in hardware keyboard shortcuts, specifically the up and down arrow keys.
|
||||||
|
guard let current = UIResponder.currentFirstResponder, !(current is PreloadedWebView) else { return nil }
|
||||||
|
|
||||||
return keyboardManager.keyCommands
|
return keyboardManager.keyCommands
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user