Skip to content

[Bug] onChange can't be dispatched after onChange callback throws an exception #1339

Description

@hata6502

Describe a bug.

Steps to reproduce:

  1. Implement onChange callback that throws an exception.
onChange: () => {
  throw new Error();
}
  1. Modify anywhere and dispatch onChange.

  2. Throws an exception.

  3. onChange can't be dispatched next time.

Expected behavior:
onChange is dispatched after onChange callback throws an exception

Editor.js version: 2.18.0

It seems that modificationObserver is disabled after onChange callback throws an exception.
It can be resolved by using try {} finally {} sentence.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions