Skip to content

Define new "block-updated" event.  #2221

@krisnik

Description

@krisnik

The question.

How to differentiate Block Update (vs) Block insert / delete.

Why and how the question has come up.

When block is updated using block.update(id, BlockToolData) - EditorJS onChange api gets called twice. once with blocked-removed and later with block-added events.

block-removed and block-added events are also fired when the blocks are deleted / added to the EditorJS instance.

Hence, from the onChange response, it is not possible to differentiate if block's content is updated or a new block is added / existing block is removed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions