Skip to content

Commit

Permalink
[Lexical] add null check for key undefined before calling toLowerCase…
Browse files Browse the repository at this point in the history
… function (#6154)
  • Loading branch information
Sahejkm authored May 21, 2024
1 parent 6795e91 commit 6b4c1dc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/lexical/src/LexicalEvents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1005,6 +1005,10 @@ function onKeyDown(event: KeyboardEvent, editor: LexicalEditor): void {
return;
}

if (key == null) {
return;
}

if (isMoveForward(key, ctrlKey, altKey, metaKey)) {
dispatchCommand(editor, KEY_ARROW_RIGHT_COMMAND, event);
} else if (isMoveToEnd(key, ctrlKey, shiftKey, altKey, metaKey)) {
Expand Down

0 comments on commit 6b4c1dc

Please sign in to comment.