fix non-handled keyboard events coming from code mirror

This commit is contained in:
azivner 2018-01-22 21:29:56 -05:00
parent 9760eb71d3
commit d8b7763dea

View File

@ -138,11 +138,9 @@
keys = handleObj.data.keys.toLowerCase().split(" "); keys = handleObj.data.keys.toLowerCase().split(" ");
handleObj.handler = function(event) { handleObj.handler = function(event) {
// Don't fire in text-accepting inputs that we didn't directly bind to if (jQuery.hotkeys.options.filterTextInputs &&
if (this !== event.target && (/textarea|select/i.test(event.target.nodeName) ||
(jQuery.hotkeys.options.filterTextInputs &&
event.target.tagName != 'WEBVIEW' && event.target.tagName != 'WEBVIEW' &&
jQuery.inArray(event.target.type, jQuery.hotkeys.textAcceptingInputTypes) > -1))) { jQuery.inArray(event.target.type, jQuery.hotkeys.textAcceptingInputTypes) > -1) {
return; return;
} }