codex-team / codex-team/editor.js

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

Open
#2,874 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
31.9k
Forks
2.2k
Avg merge
1d 1h
Merged PRs (30d)
1

Description

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/editorjs@2.30.7`

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.