From 344e1e61efc19dcfef1a0aef80a07f3283820f6c Mon Sep 17 00:00:00 2001 From: Mavis Bot Date: Wed, 5 Aug 2026 21:38:26 +0000 Subject: [PATCH] fix : checked return value of textArea.select in clipboard fallback --- utils/clipboard.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/utils/clipboard.ts b/utils/clipboard.ts index 6b5e96295..a6958288b 100644 --- a/utils/clipboard.ts +++ b/utils/clipboard.ts @@ -10,7 +10,8 @@ export const fallbackCopyToClipboard = (text: string): boolean => { document.body.appendChild(textArea); textArea.focus(); - textArea.select(); + const selected = textArea.select(); + if (!selected) return false; return document.execCommand('copy'); } catch {