dimitrov-adrian/directus-extension-editorjs-interface

Editorjs instance does not update when interface value changes

AugustsK opened this issue · 3 comments

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

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.

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