Skip to content

Commit

Permalink
Fix keyboard event issue (#251)
Browse files Browse the repository at this point in the history
  • Loading branch information
JiuqingSong authored Mar 5, 2019
1 parent 09ba3fd commit 72da532
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "roosterjs",
"version": "7.2.2",
"version": "7.2.3",
"description": "Framework-independent javascript editor",
"repository": {
"type": "git",
Expand Down
9 changes: 8 additions & 1 deletion packages/roosterjs-editor-core/lib/coreAPI/attachDomEvent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down

0 comments on commit 72da532

Please sign in to comment.