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

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

Closed
hata6502 opened this issue Oct 3, 2020 · 2 comments
Labels

Comments

@hata6502
Copy link
Contributor

hata6502 commented Oct 3, 2020

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.

@neSpecc
Copy link
Member

neSpecc commented Oct 6, 2020

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

@gohabereg
Copy link
Member

gohabereg commented Oct 6, 2020

Error should be in the save method to reproduce

@hata6502 hata6502 closed this as completed Oct 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants