Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to differentiate block content delete vs clear / re-renders. #2505

Open
krisnik opened this issue Oct 11, 2023 · 2 comments
Open

Ability to differentiate block content delete vs clear / re-renders. #2505

krisnik opened this issue Oct 11, 2023 · 2 comments
Labels

Comments

@krisnik
Copy link

krisnik commented Oct 11, 2023

Describe a bug.

In 2.28.x release, editorjs clear method triggers EditorJS onChange method with block-removed event type.

Side effect of it being, upon toggling readOnly - all the blocks are being cleared and re-rendered. With these events, the onChange event listener ends up deleting the blocks that are stored in our local state that are updated based on block-update, block-created and block-removed events.

What we would need is some sort of flag to differentiate between actual delete vs clear + re-render for us to ignore such events on event listener.

Steps to reproduce:

Here is the code snippet from readOnly.ts

https://github.com/codex-team/editor.js/blob/next/src/components/modules/readonly.ts#L97-#L102

Expected behavior:

Screenshots:

Device, Browser, OS:

Editor.js version:

Plugins you use with their versions:

@krisnik krisnik added the bug label Oct 11, 2023
@krisnik
Copy link
Author

krisnik commented Oct 19, 2023

Hello @neSpecc , Could you please suggest a work around / solution here?

@ErBat
Copy link

ErBat commented May 22, 2024

Having the same issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants