From 81b38d88080ddd0f9275bc936a0bd7d42d2d2685 Mon Sep 17 00:00:00 2001 From: David Luzar Date: Sun, 5 Apr 2020 22:31:59 +0200 Subject: [PATCH] fix wysiwyg event cleanup (#1248) --- src/element/textWysiwyg.tsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/element/textWysiwyg.tsx b/src/element/textWysiwyg.tsx index 2a732caf..32afe6ca 100644 --- a/src/element/textWysiwyg.tsx +++ b/src/element/textWysiwyg.tsx @@ -139,6 +139,12 @@ export function textWysiwyg({ } function cleanup() { + // remove events to ensure they don't late-fire + editable.onblur = null; + editable.onpaste = null; + editable.oninput = null; + editable.onkeydown = null; + window.removeEventListener("wheel", stopEvent, true); document.body.removeChild(editable); }