Skip to content

Virtual whiteboard for sketching hand-drawn like diagrams

fix(editor): copying to clipboard with no ClipboardEvent (#10729)

David Luzar54a98268177c
diff --git a/packages/excalidraw/clipboard.ts b/packages/excalidraw/clipboard.ts
index 55fa2b92c3..6033b857af 100644
--- a/packages/excalidraw/clipboard.ts
+++ b/packages/excalidraw/clipboard.ts
@@ -635,13 +635,13 @@ export const copyTextToSystemClipboard = async <
throw new Error("Failed to setData on clipboardEvent");
}
}
+ return;
}
- return;
} catch (error: any) {
console.error(error);
}
- let plainTextEntry = entries.find(
+ const plainTextEntry = entries.find(
([mimeType]) => mimeType === MIME_TYPES.text,
);
@@ -653,9 +653,7 @@ export const copyTextToSystemClipboard = async <
// NOTE: doesn't work on FF on non-HTTPS domains, or when document
// not focused
await navigator.clipboard.writeText(plainTextEntry[1]);
-
- // invalidate it so we don't write it again below
- plainTextEntry = undefined;
+ return;
} catch (error: any) {
console.error(error);
}
diff --git a/packages/excalidraw/components/FilledButton.scss b/packages/excalidraw/components/FilledButton.scss
index 431a46a63b..3257a81217 100644
--- a/packages/excalidraw/components/FilledButton.scss
+++ b/packages/excalidraw/components/FilledButton.scss
@@ -53,6 +53,7 @@
&.ExcButton--status-loading,
&.ExcButton--status-success {
pointer-events: none;
+ background-color: var(--color-success);
.ExcButton__contents {
visibility: hidden;