codex-team / editor.js

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

[Bug] Missing last block when pasting multiple paragraphs #2213

Open agonqorolli opened 1 year ago

agonqorolli commented 1 year ago

Describe a bug.

Steps to reproduce:

  1. Go to https://editorjs.io/
  2. Remove all content in live editor demo
  3. Paste multiple paragraphs (eg. three)
  4. Then all three paragraphs are visible in editor
  5. But last one is missing in generated clean data section

Expected behavior: All pasted blocks should be available in clean data

Screenshots:

Screenshot 2022-12-11 at 17 11 32

Device, Browser, OS: Chrome browser in MacOS.

Editor.js version: Not sure

Plugins you use with their versions: Not sure

kanejamison commented 1 year ago

Just wanted to confirm I am still able to replicate this in the 2.26.4 version that is running on the Editorjs.io homepage right now.

ArunBohra12 commented 1 year ago

Hi, @kanejamison have you found a way to solve it yet (any workaround would work as well), I'm having the same issue with the editor and can't seem to solve it.

iraklisg commented 1 year ago

Debouncing the onChange callback function seems to do the trick


// requires lodash

editorConfig.onChange = _.debounce(function() {...}, 200}
ArunBohra12 commented 1 year ago

Hi @iraklisg, thanks for suggesting it. I'll try that.

ArunBohra12 commented 1 year ago

Debouncing the onChange callback function seems to do the trick

// requires lodash

editorConfig.onChange = _.debounce(function() {...}, 200}

This does solve the issue. Thanks for suggesting it.

medzhidov commented 1 year ago

Still not fixed

medzhidov commented 1 year ago

One important thing: this bug can be reproduced ONLY on windows, macos works perfectly