Skip to content

Commit

Permalink
add check for defaultPrevented event
Browse files Browse the repository at this point in the history
  • Loading branch information
antonmedv committed Apr 12, 2020
1 parent b4d6485 commit 902a4fb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion codejar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ export function CodeJar(editor: HTMLElement, highlight: (e: HTMLElement) => void
}

on("keydown", event => {
if (event.defaultPrevented) return

handleNewLine(event)
handleTabCharacters(event)
handleJumpToBeginningOfLine(event)
Expand All @@ -73,7 +75,8 @@ export function CodeJar(editor: HTMLElement, highlight: (e: HTMLElement) => void
})

on("keyup", event => {
if(event.isComposing) return
if (event.defaultPrevented) return
if (event.isComposing) return

debounceHighlight()
debounceRecordHistory(event)
Expand Down

0 comments on commit 902a4fb

Please sign in to comment.