Editor.js: [Bug] onChange can't be dispatched after onChange callback throws an exception

Created on 3 Oct 2020  路  2Comments  路  Source: codex-team/editor.js

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.

bug

Most helpful comment

I've followed these steps and couldn't reproduce a problem: error triggered in every changing
image

All 2 comments

I've followed these steps and couldn't reproduce a problem: error triggered in every changing
image

Error should be in the save method to reproduce

Was this page helpful?
0 / 5 - 0 ratings

Related issues

natterstefan picture natterstefan  路  5Comments

vincentdesmares picture vincentdesmares  路  3Comments

neSpecc picture neSpecc  路  4Comments

Someskumarasamy picture Someskumarasamy  路  4Comments

davedbase picture davedbase  路  3Comments