From bcdd3f62f6fff305a8cbc72025f45772f7f265a6 Mon Sep 17 00:00:00 2001 From: Leo Liang <36321327+foxhatleo@users.noreply.github.com> Date: Wed, 11 Dec 2024 21:01:54 -0800 Subject: [PATCH] fix: remove unnecessary if condition for meta key handling (#504) --- src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 89cc0dba..669dcc4a 100644 --- a/src/index.js +++ b/src/index.js @@ -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.