codex-team / codex-team/editor.js
Ability to differentiate block content delete vs clear / re-renders.
- Dominant language
- TypeScript
- Stars
- 31.9k
- Forks
- 2.2k
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 1
Description
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:
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.