From 54a98268177c19cee7a49d05ce56e64f7a424db1 Mon Sep 17 00:00:00 2001 From: David Luzar <5153846+dwelle@users.noreply.github.com> Date: Sun, 1 Feb 2026 11:06:37 +0100 Subject: [PATCH] fix(editor): copying to clipboard with no ClipboardEvent (#10729) * fix(editor): copying to clipboard with no ClipboardEvent * fix(editor): use green for `success` state of `FilledButton` --- packages/excalidraw/clipboard.ts | 8 +++----- packages/excalidraw/components/FilledButton.scss | 1 + 2 files changed, 4 insertions(+), 5 deletions(-) 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;