Skip to content

Commit

Permalink
fix: prevent Editor.js keydown event
Browse files Browse the repository at this point in the history
  • Loading branch information
hata6502 committed Sep 11, 2020
1 parent e385e93 commit 0c55f1e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ class EditorJSStyle implements InlineTool {
private static initializeSpan({ span }: { span: HTMLSpanElement }) {
span.classList.add('editorjs-style');

// To prevent Editor.js keydown event
span.addEventListener('keydown', (event) => event.stopPropagation());

const mutationObserver = new MutationObserver(() => {
if (
span.firstChild?.nodeName !== '#text' ||
Expand Down

0 comments on commit 0c55f1e

Please sign in to comment.