Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unnecessary if condition for meta key handling / 去除处理meta key的多余if条件判断 #504

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading