diff --git a/dist/hotkeys.common.js b/dist/hotkeys.common.js index c72eaa22..9c5df205 100644 --- a/dist/hotkeys.common.js +++ b/dist/hotkeys.common.js @@ -1,5 +1,5 @@ /*! - * hotkeys-js v3.3.6 + * hotkeys-js v3.3.7 * A simple micro-library for defining and dispatching keyboard shortcuts. It has no dependencies. * * Copyright (c) 2018 kenny wong @@ -151,9 +151,11 @@ function getPressedKeyCodes() { // 表单控件控件判断 返回 Boolean function filter(event) { - var tagName = event.target.tagName || event.srcElement.tagName; - // 忽略这些标签情况下快捷键无效 - return !(tagName === 'INPUT' || tagName === 'SELECT' || tagName === 'TEXTAREA'); + var target = event.target || event.srcElement; + var tagName = target.tagName; + // 忽略这些情况下快捷键无效 + + return !(tagName === 'INPUT' || tagName === 'SELECT' || tagName === 'TEXTAREA' || target.isContentEditable); } // 判断摁下的键是否为某个键,返回true或者false diff --git a/dist/hotkeys.common.min.js b/dist/hotkeys.common.min.js index b1c4c241..52cacfae 100644 --- a/dist/hotkeys.common.min.js +++ b/dist/hotkeys.common.min.js @@ -1,2 +1,2 @@ -/*! hotkeys-js v3.3.6 | MIT (c) 2018 kenny wong | http://jaywcjlove.github.io/hotkeys */ -"use strict";var isff="undefined"!=typeof navigator&&0 | http://jaywcjlove.github.io/hotkeys */ +"use strict";var isff="undefined"!=typeof navigator&&0 @@ -149,9 +149,11 @@ function getPressedKeyCodes() { // 表单控件控件判断 返回 Boolean function filter(event) { - var tagName = event.target.tagName || event.srcElement.tagName; - // 忽略这些标签情况下快捷键无效 - return !(tagName === 'INPUT' || tagName === 'SELECT' || tagName === 'TEXTAREA'); + var target = event.target || event.srcElement; + var tagName = target.tagName; + // 忽略这些情况下快捷键无效 + + return !(tagName === 'INPUT' || tagName === 'SELECT' || tagName === 'TEXTAREA' || target.isContentEditable); } // 判断摁下的键是否为某个键,返回true或者false diff --git a/dist/hotkeys.js b/dist/hotkeys.js index 3c9510db..559a5cb1 100644 --- a/dist/hotkeys.js +++ b/dist/hotkeys.js @@ -1,5 +1,5 @@ /*! - * hotkeys-js v3.3.6 + * hotkeys-js v3.3.7 * A simple micro-library for defining and dispatching keyboard shortcuts. It has no dependencies. * * Copyright (c) 2018 kenny wong @@ -155,9 +155,11 @@ // 表单控件控件判断 返回 Boolean function filter(event) { - var tagName = event.target.tagName || event.srcElement.tagName; - // 忽略这些标签情况下快捷键无效 - return !(tagName === 'INPUT' || tagName === 'SELECT' || tagName === 'TEXTAREA'); + var target = event.target || event.srcElement; + var tagName = target.tagName; + // 忽略这些情况下快捷键无效 + + return !(tagName === 'INPUT' || tagName === 'SELECT' || tagName === 'TEXTAREA' || target.isContentEditable); } // 判断摁下的键是否为某个键,返回true或者false diff --git a/dist/hotkeys.min.js b/dist/hotkeys.min.js index 3cd52009..e30491c5 100644 --- a/dist/hotkeys.min.js +++ b/dist/hotkeys.min.js @@ -1,2 +1,2 @@ -/*! hotkeys-js v3.3.6 | MIT (c) 2018 kenny wong | http://jaywcjlove.github.io/hotkeys */ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.hotkeys=t()}(this,function(){"use strict";var e="undefined"!=typeof navigator&&0 | http://jaywcjlove.github.io/hotkeys */ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.hotkeys=t()}(this,function(){"use strict";var e="undefined"!=typeof navigator&&0