Skip to content

Editorjs instance does not update when interface value changes #45

@AugustsK

Description

@AugustsK

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions