Skip to content

Deleting images or changing style not triggering onChange #5

@pabloprieto

Description

@pabloprieto

can be reproduced with the following code:

import EditorJS from "@editorjs/editorjs";
import Gallery from "@kiberpro/editorjs-gallery";
import Sortable from "sortablejs";

const editorContainer = document.getElementById("editor");
const uploadUrl = "/upload";

const editor = new EditorJS({
  holder: editorContainer,
  tools: {
    gallery: {
      class: Gallery,
      config: {
        sortableJs: Sortable,
        endpoints: {
          byFile: uploadUrl,
          byUrl: uploadUrl,
        },
        field: "file",
      },
    },
  },
  onChange: () => {
    editor.save().then((data) => {
      console.debug(data);
    });
  },
});

Adding or moving images correctly trigger EditorJs onChange event, but removing images or changing style does not. Any workaround or suggestion to make it work?

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