When multiple EditorJS instances are initialized on the same page, the second instance fails to register its inline tool shortcuts, causing an error thrown by Shortcuts.add().
This was introduced by the change from this.Editor.UI.nodes.redactor to document as the on target in inline.ts > enableShortcuts(). https://github.com/codex-team/editor.js/pull/2891/changes#diff-e55ad4bb9846bb8d75e77413ab3e49c30e75f6bb8b58833d2b539cebb8186b10
- Create two or more EditorJS instances on the same page with inline tools that have shortcuts (e.g.
bold, italic, inlineCode)
- Initialize the second instance
- Observe the error
Expected behavior: Multiple EditorJS instances should be able to coexist on the same page without conflicting on inline shortcut registration.
Suggested Fix: One possible approach would be to conditionally bind shortcuts depending on the read-only mode.
Screenshots:
Device, Browser, OS: Chromium 147.0.7727.116
Editor.js version: 2.31.6
Plugins you use with their versions: N/A
When multiple EditorJS instances are initialized on the same page, the second instance fails to register its inline tool shortcuts, causing an error thrown by
Shortcuts.add().This was introduced by the change from
this.Editor.UI.nodes.redactortodocumentas theontarget ininline.ts > enableShortcuts(). https://github.com/codex-team/editor.js/pull/2891/changes#diff-e55ad4bb9846bb8d75e77413ab3e49c30e75f6bb8b58833d2b539cebb8186b10bold,italic,inlineCode)Expected behavior: Multiple EditorJS instances should be able to coexist on the same page without conflicting on inline shortcut registration.
Suggested Fix: One possible approach would be to conditionally bind shortcuts depending on the read-only mode.
Screenshots:
Device, Browser, OS: Chromium 147.0.7727.116
Editor.js version: 2.31.6
Plugins you use with their versions: N/A