editor.js: [Bug] Uncaught TypeError: Cannot read property 'updateCurrentInput' of undefined
When I click on a block of any EditorJS instance when there are two editors in the same page, I get the following error:
Uncaught TypeError: Cannot read property 'updateCurrentInput' of undefined
This is where the error is produced:
Steps to reproduce:
- Create two editors in the same page
- Click on a block
Expected behavior: No errors reported to the console.
Device, Browser, OS: Chromium 87
Editor.js version: 2.19.1
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 16
- Comments: 19 (3 by maintainers)
https://github.com/codex-team/editor.js/pull/1364/files#diff-73cbc05ddd84b0686ee89460cb98dfc39099c8472677e743192f301e26c2347cR584
This error occurs in
BlockManager.setCurrentBlockByChildNode()I sent a pull request.
Hi, I have the same problem. Currently using the editor on a Modal developed on React. When you open the modal again the error appears on the console.
Hello, I’m trying to figure this out too. I’m currently working on an app that requires displaying more than one editor at the same time.
It all works perfectly until I start using editorjs plugins, such as the code plugin. When two or more editors are open and I start typing in them, this error is triggered.
Has anybody solved this?
Currently using it on a NextJS app at the 2.19.3 version (the latest one 2.22.2 also crashes).
Hey guys, Had the same issue using React and was digging around for days trying to fix it. Figured out a way that seems to work.
Make sure you are initializing the editor using Class-based component, and then call editor.destroy() on unmount
componentWillUnmount() { this.editor.destroy() }I got the same. Using editor on modal with Vuejs
This bug occurs in the following demo page. https://hata6502.github.io/editorjs-inline/
Editor.js supported multiple instances in v.2.18.0. But it seems broken in recently version.
Still seeing this with 2.22.2, using
react-router-hash-linkto scroll to header blocks in the editor. I guess it’s EditorJS is complaining about HashLink’s focus management, which is trying to give focus to the heading contenteditable.Hello 👋
I am having this problem when switching from a regular input to EditorJS input by pressing
tabkey while there are multiple EditorJS instances present on the page.Below is the demo page to reproduce the error. When the page loads first click on the input and then press
tabthen notice the error.https://codesandbox.io/s/editorjs-cgsmq?file=/src/App.vue
Seems editor.js does not support multiple editors in one page?
this.editor.destroy()works for me too in Vue.jsI got the same error using the editor in nuxtjs. I have a toggle button which hides the editor. After toggling once the error occurs.