codex-team / editor.js

A block-style editor with clean JSON output
https://editorjs.io
Apache License 2.0
28.52k stars 2.08k forks source link

Error: Cannot read properties of undefined (reading 'updateCurrentInput') #2400

Closed SamiOP75 closed 1 year ago

SamiOP75 commented 1 year ago

Hello 👋

I'm currently encountering this error while trying to paste text on my editor in the first block.

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'updateCurrentInput')

In my case, I've editor js data in my clipboard which failed because of this error, and then it paste the copied data as text.

To avoid, this I always had to insert a new block and then paste it into the block created. It'll then paste the block into my editor as expected.

Steps to reproduce:

  1. Select a list of blocks (in order to copy them as editorjs data)
  2. Copy the blocks selected (copy as editorjs data, not plain text or HTML)
  3. Open a new editor
  4. Make sure that your editor had only one block (one line)
  5. Paste copied block into your editor.

Expected behavior: It pastes the copied blocks as editor js blocks

Screenshots:

https://github.com/codex-team/editor.js/assets/89921895/d95312b5-e695-4c0e-9e6f-e461f31f9c8f

image

Device, Browser, OS: Mac M1, Chrome

Editor.js version: 2.27.2

Plugins you use with their versions: @editorjs/paragraph — Paragraph block @editorjs/list — List block (Customized) @editorjs/image — Image block editorjs-alert - Alert block (Customized)

SamiOP75 commented 1 year ago

Hello,

I'm back with some news. I hope it will help people who have potentially experienced the same problem as me or this error.

I found the origin of the problem it did not come from the source code of editorjs but ours, we have indeed added a button for our own needs at the same level as the block of the editor, which impacted because we noticed that the editor count our button as a block which distorted the number of blocks and had an impact when copied and pasted blocks.