fix wysiwyg event cleanup (#1248)

This commit is contained in:
David Luzar 2020-04-05 22:31:59 +02:00 committed by GitHub
parent 290244660b
commit 81b38d8808
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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);
}