Skip to content

Commit

Permalink
test: fix test case error. (#433)
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Jun 25, 2023
1 parent 8b8d7d9 commit eb20660
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 21 deletions.
8 changes: 4 additions & 4 deletions dist/hotkeys.common.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/**!
* hotkeys-js v3.10.1
* hotkeys-js v3.10.2
* A simple micro-library for defining and dispatching keyboard shortcuts. It has no dependencies.
*
* Copyright (c) 2022 kenny wong <wowohoo@qq.com>
* Copyright (c) 2023 kenny wong <wowohoo@qq.com>
* http://jaywcjlove.github.io/hotkeys
* Licensed under the MIT license
*/
Expand Down Expand Up @@ -464,7 +464,7 @@ function dispatch(event, element) {

for (var _i = 0; _i < _handlers[key].length; _i++) {
if (event.type === 'keydown' && _handlers[key][_i].keydown || event.type === 'keyup' && _handlers[key][_i].keyup) {
if (_handlers[key][_i].key) {
if (_handlers[key][_i].key && _handlers[key][_i].scope === scope) {
var record = _handlers[key][_i];
var splitKey = record.splitKey;
var keyShortcut = record.key.split(splitKey);
Expand All @@ -474,7 +474,7 @@ function dispatch(event, element) {
_downKeysCurrent.push(code(keyShortcut[a]));
}

if (_downKeysCurrent.sort().join('') === _downKeys.sort().join('')) {
if (_downKeysCurrent.sort().join('') === _downKeys.slice().sort().join('')) {
// 找到处理内容
eventHandler(event, record, scope, element);
}
Expand Down
4 changes: 2 additions & 2 deletions dist/hotkeys.common.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions dist/hotkeys.esm.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/**!
* hotkeys-js v3.10.1
* hotkeys-js v3.10.2
* A simple micro-library for defining and dispatching keyboard shortcuts. It has no dependencies.
*
* Copyright (c) 2022 kenny wong <wowohoo@qq.com>
* Copyright (c) 2023 kenny wong <wowohoo@qq.com>
* http://jaywcjlove.github.io/hotkeys
* Licensed under the MIT license
*/
Expand Down Expand Up @@ -462,7 +462,7 @@ function dispatch(event, element) {

for (var _i = 0; _i < _handlers[key].length; _i++) {
if (event.type === 'keydown' && _handlers[key][_i].keydown || event.type === 'keyup' && _handlers[key][_i].keyup) {
if (_handlers[key][_i].key) {
if (_handlers[key][_i].key && _handlers[key][_i].scope === scope) {
var record = _handlers[key][_i];
var splitKey = record.splitKey;
var keyShortcut = record.key.split(splitKey);
Expand All @@ -472,7 +472,7 @@ function dispatch(event, element) {
_downKeysCurrent.push(code(keyShortcut[a]));
}

if (_downKeysCurrent.sort().join('') === _downKeys.sort().join('')) {
if (_downKeysCurrent.sort().join('') === _downKeys.slice().sort().join('')) {
// 找到处理内容
eventHandler(event, record, scope, element);
}
Expand Down
8 changes: 4 additions & 4 deletions dist/hotkeys.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/**!
* hotkeys-js v3.10.1
* hotkeys-js v3.10.2
* A simple micro-library for defining and dispatching keyboard shortcuts. It has no dependencies.
*
* Copyright (c) 2022 kenny wong <wowohoo@qq.com>
* Copyright (c) 2023 kenny wong <wowohoo@qq.com>
* http://jaywcjlove.github.io/hotkeys
* Licensed under the MIT license
*/
Expand Down Expand Up @@ -468,7 +468,7 @@

for (var _i = 0; _i < _handlers[key].length; _i++) {
if (event.type === 'keydown' && _handlers[key][_i].keydown || event.type === 'keyup' && _handlers[key][_i].keyup) {
if (_handlers[key][_i].key) {
if (_handlers[key][_i].key && _handlers[key][_i].scope === scope) {
var record = _handlers[key][_i];
var splitKey = record.splitKey;
var keyShortcut = record.key.split(splitKey);
Expand All @@ -478,7 +478,7 @@
_downKeysCurrent.push(code(keyShortcut[a]));
}

if (_downKeysCurrent.sort().join('') === _downKeys.sort().join('')) {
if (_downKeysCurrent.sort().join('') === _downKeys.slice().sort().join('')) {
// 找到处理内容
eventHandler(event, record, scope, element);
}
Expand Down

0 comments on commit eb20660

Please sign in to comment.