django-editorjs-fields icon indicating copy to clipboard operation
django-editorjs-fields copied to clipboard

How to detect onChange callback?

Open zobweyt opened this issue 2 years ago • 0 comments

I need to use onChange event to detect changes in form and enable submit button. I tried to create an instance of editorjs in my script file, but the callback did not work:

new EditorJS({
    holderId: 'id_body_editorjs_holder',
    onChange: (api, event) => {
      console.log('changed');
    },
});

But if I create an editor from scratch without the Django plugin, then I can track this event:

<div id="editorjs"/>
<script type="module">
  new EditorJS({
    onChange: (api, event) => {
      console.log('changed');
    },
  });
</script>

zobweyt avatar Feb 15 '23 07:02 zobweyt