Closed cer718 closed 2 years ago
I tried calling editor.clear(), but the following error occurs in the event handler.
Uncaught TypeError: Cannot read properties of undefined (reading 'data')
at i.getNodeFromId (drawflow.min.js?21b5:1:29555)
at eval (index.tsx?07ff:311:60)
at eval (drawflow.min.js?21b5:1:45969)
at Array.forEach (<anonymous>)
at i.dispatch (drawflow.min.js?21b5:1:45932)
at i.click `(drawflow.min.js?21b5:1:5538)
Remove events with:
editor.events = {};
// Register new events.
Or remove manual event create:
editor.removeListener(event, callback);
Thanks for your help 👍 It works well
Hi,
I registered
<div id='drawflow'>
and deleted it after using it.const el = document.getElementsByClassName('drawflow')[0];
el?.remove();
And if you try to register and use a new
<div id='drawflow'>
, the event occurs twice.Is there any way to delete the editor's event listener when deleting an element?
Thanks for helping