Virtual whiteboard for sketching hand-drawn like diagrams
Allow copy pasting inside of wysiwyg element (#651)
Christopher Chedeau70db79254935
diff --git a/src/element/textWysiwyg.tsx b/src/element/textWysiwyg.tsxindex 584af1c617..d705627280 100644--- a/src/element/textWysiwyg.tsx+++ b/src/element/textWysiwyg.tsx@@ -73,14 +73,6 @@ export function textWysiwyg({}};editable.onblur = handleSubmit;- // override paste to disallow non-textual data, and replace newlines- editable.onpaste = ev => {- ev.preventDefault();- try {- const text = ev.clipboardData!.getData("text").replace(/\n+/g, " ");- editable.textContent = text;- } catch {}- };function stopEvent(ev: Event) {ev.stopPropagation();@@ -98,7 +90,6 @@ export function textWysiwyg({function cleanup() {editable.onblur = null;editable.onkeydown = null;- editable.onpaste = null;window.removeEventListener("wheel", stopEvent, true);document.body.removeChild(editable);}diff --git a/src/utils.ts b/src/utils.tsindex bcbbb6d4ba..2d5a0269b8 100644--- a/src/utils.ts+++ b/src/utils.ts@@ -31,6 +31,7 @@ export function isInputLike(| HTMLDivElement {return ((target instanceof HTMLElement && target.dataset.type === "wysiwyg") ||+ target instanceof HTMLBRElement || // newline in wysiwygtarget instanceof HTMLInputElement ||target instanceof HTMLTextAreaElement ||target instanceof HTMLSelectElement