Skip to content

Commit 19d3fa7

Browse files
authored
refactor: event.keyCode -> key (#23)
1 parent b15f878 commit 19d3fa7

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/editor.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,7 @@ class CodeElement extends EventTarget {
9090
if (!event.ctrlKey && !event.metaKey) {
9191
return;
9292
}
93-
// 10 and 13 are Enter codes
94-
if (event.keyCode != 10 && event.keyCode != 13) {
93+
if (event.key !== "Enter" && event.key !== "NumpadEnter") {
9594
return;
9695
}
9796
event.preventDefault();

0 commit comments

Comments
 (0)