-
-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Following the example in the documentation, the dropzone is looking like this when dragging a file with a prohibited type into the zone.
In the preview of the documentation, the state resets after dropping the file.
I am using "react-dropzone": "^14.3.8"
Probably related to this issue: react-dropzone/react-dropzone#1415
import * as React from "react";
import {
Dropzone,
DropzoneDescription,
DropzoneGroup,
DropzoneInput,
DropzoneTitle,
DropzoneUploadIcon,
DropzoneZone,
} from "@/components/drop-zone";
import {
FileList,
FileListDescription,
FileListHeader,
FileListIcon,
FileListInfo,
FileListItem,
FileListName,
FileListSize,
} from "@/components/ui/file-list";
export default function DropzoneDemo() {
const [files, setFiles] = React.useState([]);
return (
<Dropzone
accept={{
"image/*": [".jpg", ".png"],
"application/pdf": [".pdf"],
}}
onDropAccepted={setFiles}
>
<div className="grid gap-4">
<DropzoneZone>
<DropzoneInput />
<DropzoneGroup className="gap-4">
<DropzoneUploadIcon />
<DropzoneGroup>
<DropzoneTitle>Drop files here or click to upload</DropzoneTitle>
<DropzoneDescription>
You can upload files up to 10MB in size. Supported formats: JPG,
PNG, PDF.
</DropzoneDescription>
</DropzoneGroup>
</DropzoneGroup>
</DropzoneZone>
<FileList>
{files.map((file) => (
<FileListItem key={file.name}>
<FileListHeader>
<FileListIcon />
<FileListInfo>
<FileListName>{file.name}</FileListName>
<FileListDescription>
<FileListSize>{file.size}</FileListSize>
</FileListDescription>
</FileListInfo>
</FileListHeader>
</FileListItem>
))}
</FileList>
</div>
</Dropzone>
);
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working