From c6f430a895e80a339d57d2a56248b7f52450072a Mon Sep 17 00:00:00 2001 From: fantasticit Date: Fri, 5 Aug 2022 17:43:53 +0800 Subject: [PATCH] tiptap: remove listener before destroy --- packages/client/src/tiptap/core/extensions/dragable.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/client/src/tiptap/core/extensions/dragable.ts b/packages/client/src/tiptap/core/extensions/dragable.ts index d6a8318..c4d352d 100644 --- a/packages/client/src/tiptap/core/extensions/dragable.ts +++ b/packages/client/src/tiptap/core/extensions/dragable.ts @@ -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(); }, };