Unverified Commit 5789d765 authored by Rhon Joe's avatar Rhon Joe Committed by GitHub

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

parent 2e588ae2
......@@ -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 {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment