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

Inconsistent Behavior: insertMany Does Not Trigger Mutation Events in Editor.js #2874

Open
tomohirohiratsuka opened this issue Nov 21, 2024 · 0 comments

Comments

@tomohirohiratsuka
Copy link

The question.

In Editor.js, various block operations such as delete, add, and move trigger the onChange event, allowing developers to handle mutations in a consistent manner. However, when using insertMany to add multiple blocks at once, the onChange event is not triggered.

This inconsistency in behavior can lead to unexpected issues, particularly in applications that rely on onChange for synchronization or state updates. For instance, developers might expect that inserting multiple blocks via insertMany would behave similarly to adding blocks one at a time, but this is not currently the case.

Would it be possible to align the behavior of insertMany with other block operations by ensuring that it triggers the onChange event? This would improve consistency and make the API more predictable for developers.

Why and how the question has come up.
Since insertMany did not fire onChange.
Using @editorjs/[email protected]

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

No branches or pull requests

1 participant