Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

fix(web): reserve default copy behavior (#1693)

Rhon Joe5789d76582f2
diff --git a/web/app/components/base/image-uploader/hooks.ts b/web/app/components/base/image-uploader/hooks.ts
index 54b08b6ac0f..bb929f4a40f 100644
--- a/web/app/components/base/image-uploader/hooks.ts
+++ b/web/app/components/base/image-uploader/hooks.ts
@@ -197,13 +197,13 @@ export const useClipboardUploader = ({ visionConfig, onUpload, files }: useClipb
const { handleLocalFileUpload } = useLocalFileUploader({ limit, onUpload, disabled })
const handleClipboardPaste = useCallback((e: ClipboardEvent<HTMLTextAreaElement>) => {
- e.preventDefault()
+ // reserve native text copy behavior
const file = e.clipboardData?.files[0]
-
- if (!file)
- return
-
- handleLocalFileUpload(file)
+ // when copyed file, prevent default action
+ if (file) {
+ e.preventDefault()
+ handleLocalFileUpload(file)
+ }
}, [handleLocalFileUpload])
return {