From a3fd79dae856e85d7f7e237f81095ef69b763327 Mon Sep 17 00:00:00 2001 From: Philip Okugbe <16838612+Philipinho@users.noreply.github.com> Date: Mon, 2 Mar 2026 17:37:56 +0000 Subject: [PATCH] fix: spreadsheets paste (#1982) --- .../editor/components/common/editor-paste-handler.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/client/src/features/editor/components/common/editor-paste-handler.tsx b/apps/client/src/features/editor/components/common/editor-paste-handler.tsx index dea1f73c..6407d835 100644 --- a/apps/client/src/features/editor/components/common/editor-paste-handler.tsx +++ b/apps/client/src/features/editor/components/common/editor-paste-handler.tsx @@ -54,7 +54,10 @@ export const handlePaste = ( return true; } - if (event.clipboardData?.files.length) { + const htmlData = event.clipboardData?.getData("text/html"); + const hasHtmlTable = htmlData && /]/i.test(htmlData); + + if (event.clipboardData?.files.length && !hasHtmlTable) { event.preventDefault(); for (const file of event.clipboardData.files) { const pos = editor.state.selection.from; @@ -65,7 +68,6 @@ export const handlePaste = ( return true; } - const htmlData = event.clipboardData?.getData("text/html"); if (htmlData && ATTACHMENT_URL_RE.test(htmlData)) { const pasteFrom = editor.state.selection.from; setTimeout(() => {