소스 검색

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

tags/0.3.33
Rhon Joe 1 년 전
부모
커밋
5789d76582
No account linked to committer's email address
1개의 변경된 파일6개의 추가작업 그리고 6개의 파일을 삭제
  1. 6
    6
      web/app/components/base/image-uploader/hooks.ts

+ 6
- 6
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 {

Loading…
취소
저장