From 72da5323118ba592caf264e5d942284725128da1 Mon Sep 17 00:00:00 2001 From: Jiuqing Song Date: Tue, 5 Mar 2019 11:02:37 -0800 Subject: [PATCH] Fix keyboard event issue (#251) --- package.json | 2 +- .../roosterjs-editor-core/lib/coreAPI/attachDomEvent.ts | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 5a000d00c32..46fd61d2b30 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "roosterjs", - "version": "7.2.2", + "version": "7.2.3", "description": "Framework-independent javascript editor", "repository": { "type": "git", diff --git a/packages/roosterjs-editor-core/lib/coreAPI/attachDomEvent.ts b/packages/roosterjs-editor-core/lib/coreAPI/attachDomEvent.ts index 9eae60b5bb5..64f6d96b950 100644 --- a/packages/roosterjs-editor-core/lib/coreAPI/attachDomEvent.ts +++ b/packages/roosterjs-editor-core/lib/coreAPI/attachDomEvent.ts @@ -12,7 +12,14 @@ const attachDomEvent: AttachDomEvent = ( // This detection is not 100% accurate. event.key is not fully supported by all brwosers, and in some browser (e.g. IE) // event.key is longer than 1 for num pad input. But here we just want to improve performance as mush as possible. // So if we missed some case here it is still acceptable. - if (isKeyboardEvent(event) && event.key && event.key.length == 1) { + if ( + isKeyboardEvent(event) && + !event.ctrlKey && + !event.altKey && + !event.metaKey && + event.key && + event.key.length == 1 + ) { event.stopPropagation(); }