[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:
https://github.com/codex-team/editor.js/blob/43032ebaac6a8b9a67c9bf2ada5adc0f8592d546/src/components/modules/blockManager.ts#L566-L593
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
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.
i got the same thing
I have the same problem, using Editor.js on React
it's same for me too when i am using more than one editor instances in the same page
I got the same. Using editor on modal with Vuejs
I got the same error using the editor in nuxtjs. I have a toggle button which hides the editor. After toggling once the error occurs.
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()
}
this.editor.destroy() works for me too in Vue.js
Seems editor.js does not support multiple editors in one page?
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.
https://github.com/codex-team/editor.js/pull/1364/files#diff-73cbc05ddd84b0686ee89460cb98dfc39099c8472677e743192f301e26c2347cR584
This error occurs in BlockManager.setCurrentBlockByChildNode()
I sent a pull request.
this.editor.destroy()works for me too in Vue.js
Please show exemple.
this.editor.destroy()works for me too in Vue.js
Same solution for Angular 10 and editorjs 2.19.1:
ngOnDestroy(): void {
this.onDestroy$.next();
this.editorInstance.destroy();
}
Looks ok in 2.19.2-rc.1, doesn't crash anymore with multiple editors on same page.
But got a focus bug #1575, maybe related, thus tagging it here.
Hello 👋
I am having this problem when switching from a regular input to EditorJS input by pressing tab key 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 tab then notice the error.
https://codesandbox.io/s/editorjs-cgsmq?file=/src/App.vue
Still seeing this with 2.22.2, using react-router-hash-link to 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'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).
I'm still having same issue my version is 2.26.4. Could you fix this issue?
I can't reproduce. Tried described steps along with CodeTool, no error.
Tried in 2.27.0-rc.1.
So'll close it for now. If a problem will occur, please, recreate an issue with more accurate steps to reproduce.
Hi team, still i faced same issue "Cannot read properties of undefined (reading 'updateCurrentInput')" can you help me