We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable the option to upload a single file, simplifying the upload process for users who only need to upload one file at a time.
The current behavior allows for the upload of a single file multiple times, but not exclusively a single file.
It should be possible to upload only one file, once.
export default function DragZoneField<T extends File>({ name, ...props }: DragZoneFieldProps<T>) { const [field, , helpers] = useField(name); const fieldValue = React.useRef<string[]>(); React.useEffect(() => { props.hook.onUploadedFileIds([field.value]); fieldValue.current = field.value; }, [field.value]); React.useEffect(() => { props.hook.onUpdateCallback((added, deleted) => { if (added) { helpers.setValue(added); } else if (deleted) { helpers.setValue(null); } }); // eslint-disable-next-line react-hooks/exhaustive-deps }, []); return <DragZone hook={props.hook} url={props.url} {...props} />; }
The text was updated successfully, but these errors were encountered:
#153 - Restricting DragZoneFiled File Upload to a Single File
2a88f44
fd82ce3
f56e48a
d14a03e
Successfully merging a pull request may close this issue.
Basic information
Enhancement description
Enable the option to upload a single file, simplifying the upload process for users who only need to upload one file at a time.
Current behaviour
The current behavior allows for the upload of a single file multiple times, but not exclusively a single file.
Wanted behaviour
It should be possible to upload only one file, once.
Possible workarounds
The text was updated successfully, but these errors were encountered: