tiptap: remove listener before destroy

This commit is contained in:
fantasticit 2022-08-05 17:43:53 +08:00
parent bf4a3ec576
commit c6f430a895
1 changed files with 3 additions and 0 deletions

View File

@ -108,6 +108,9 @@ export const Dragable = Extension.create({
destroy: () => {
if (!dragHandleDOM) return;
dragHandleDOM.removeEventListener('mousedown', handleMouseDown);
dragHandleDOM.removeEventListener('mouseup', handleMouseUp);
dragHandleDOM.removeEventListener('dragstart', handleDragStart);
dragHandleDOM.remove();
},
};