Quellcode durchsuchen

FIX:microsoft word text copy and paste error (#14905)

Co-authored-by: LinYing <linying@momenta.ai>
ShadowJobs vor 1 Monat
Ursprung
Commit
0587eb4956
1 geänderte Dateien mit 2 neuen und 1 gelöschten Zeilen
  1. 2 1
      web/app/components/base/file-uploader/hooks.ts

+ 2 - 1
web/app/components/base/file-uploader/hooks.ts

@@ -310,7 +310,8 @@ export const useFile = (fileConfig: FileUpload) => {
 
   const handleClipboardPasteFile = useCallback((e: ClipboardEvent<HTMLTextAreaElement>) => {
     const file = e.clipboardData?.files[0]
-    if (file) {
+    const text = e.clipboardData?.getData('text/plain')
+    if (file && !text) {
       e.preventDefault()
       handleLocalFileUpload(file)
     }