From 6efbe449cc5e49b8b14ec5bf5d36105c64c4cb86 Mon Sep 17 00:00:00 2001 From: Mert E Date: Sun, 28 Apr 2024 06:13:02 +0300 Subject: [PATCH] fix: copyTable fallback to useCopy with plain text for insecure context (#8346) Signed-off-by: mertmit --- packages/nc-gui/composables/useMultiSelect/index.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/nc-gui/composables/useMultiSelect/index.ts b/packages/nc-gui/composables/useMultiSelect/index.ts index 97e9d154eb..2301cab053 100644 --- a/packages/nc-gui/composables/useMultiSelect/index.ts +++ b/packages/nc-gui/composables/useMultiSelect/index.ts @@ -300,7 +300,10 @@ export function useMultiSelect( const blobHTML = new Blob([copyHTML], { type: 'text/html' }) const blobPlainText = new Blob([copyPlainText], { type: 'text/plain' }) - return navigator.clipboard.write([new ClipboardItem({ [blobHTML.type]: blobHTML, [blobPlainText.type]: blobPlainText })]) + return ( + navigator.clipboard?.write([new ClipboardItem({ [blobHTML.type]: blobHTML, [blobPlainText.type]: blobPlainText })]) ?? + copy(copyPlainText) + ) } async function copyValue(ctx?: Cell) {