feat: upload support pasting file

This commit is contained in:
Arick
2022-11-16 16:07:38 +08:00
committed by Jarrod Flesch
parent 04c689c5b0
commit eb69b82adf

View File

@@ -169,6 +169,13 @@ const Upload: React.FC<Props> = (props) => {
<div
className={`${baseClass}__drop-zone`}
ref={dropRef}
onPaste={(e) => {
// handle pasted file
if (e.clipboardData.files.length) {
const fileObject = e.clipboardData.files[0];
setValue(fileObject || null);
}
}}
>
<Button
size="small"