Explorar o código

fix wysiwyg event cleanup (#1248)

David Luzar %!s(int64=5) %!d(string=hai) anos
pai
achega
81b38d8808
Modificáronse 1 ficheiros con 6 adicións e 0 borrados
  1. 6 0
      src/element/textWysiwyg.tsx

+ 6 - 0
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);
   }