Skip to content

Commit

Permalink
fix: remove unnecessary if condition for meta key handling (#504)
Browse files Browse the repository at this point in the history
  • Loading branch information
foxhatleo authored Dec 12, 2024
1 parent 335c15c commit bcdd3f6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ function dispatch(event, element) {
_downKeys.push(keyNum);
} else if (!event[keyName] && _downKeys.indexOf(keyNum) > -1) {
_downKeys.splice(_downKeys.indexOf(keyNum), 1);
} else if (keyName === 'metaKey' && event[keyName] && _downKeys.length === 3) {
} else if (keyName === 'metaKey' && event[keyName]) {
// 如果command被按下,那就清空所有除event按键外的非装饰键。
// 因为command被按下的情况下非装饰键的keyup永远都不会触发。这是已知的浏览器限制。
// If command key is pressed, clear all non-decorating keys except for key in event.
Expand Down

0 comments on commit bcdd3f6

Please sign in to comment.