From 0587eb49567b5f4bb7f9e1fe85a341a25aad0ccb Mon Sep 17 00:00:00 2001 From: ShadowJobs <794878115@qq.com> Date: Fri, 14 Mar 2025 18:31:20 +0800 Subject: [PATCH] FIX:microsoft word text copy and paste error (#14905) Co-authored-by: LinYing --- web/app/components/base/file-uploader/hooks.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/web/app/components/base/file-uploader/hooks.ts b/web/app/components/base/file-uploader/hooks.ts index b4c8fe1008..7c82e0a04e 100644 --- a/web/app/components/base/file-uploader/hooks.ts +++ b/web/app/components/base/file-uploader/hooks.ts @@ -310,7 +310,8 @@ export const useFile = (fileConfig: FileUpload) => { const handleClipboardPasteFile = useCallback((e: ClipboardEvent) => { const file = e.clipboardData?.files[0] - if (file) { + const text = e.clipboardData?.getData('text/plain') + if (file && !text) { e.preventDefault() handleLocalFileUpload(file) }