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

Editorjs instance does not update when interface value changes #45

Open
AugustsK opened this issue Oct 27, 2022 · 3 comments
Open

Editorjs instance does not update when interface value changes #45

AugustsK opened this issue Oct 27, 2022 · 3 comments

Comments

@AugustsK
Copy link

Hi

First of all, big thanks for making this interface, it's really helpful for our Directus use case.

Second, I'd like to point out a bug we encountered. It seems that editorjs is not re-rendered when the value of interface changes, for example:

  1. If editorjs interface is translated, then switching languages does not update editorjs
  2. When manually updating JSON raw value, editorjs does not update

I've tracked it down to this commit.

It looks like emitValue and watch conflict with one another. emitValue is fired when editorjs initializes and marks isInternalChange as true, but it never resets it back.

A way to fix this would be to:

  1. Revert the change in watch routine to change isInternalChange back to false, if it encounters it
  2. Add finally to emiValue promise returned that changes isInternalChange back to false

This is what we've done on our forked version of this interface to fix it for us. I'm happy to make PR here as well if necessary

@almereyda
Copy link

Would you like to contribute that PR to the community?

There are recent requests #48 to keep this extensions on par with upstream, whyfore a little activity around the edges could help to revive a healthy social environment for the code.

@AugustsK
Copy link
Author

Would you like to contribute that PR to the community?

There are recent requests #48 to keep this extensions on par with upstream, whyfore a little activity around the edges could help to revive a healthy social environment for the code.

I had successfully forgotten about this issue. Will pull up the commits we did and do a PR in the coming days

@almereyda
Copy link

almereyda commented Apr 15, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants