Reputation: 415
Basically I want to have multiple <input/>
inside one dropzone.
It would look something like that.
All the drop targets should enable their isDragActive
when entering the parent panel.
Is this at all possible with react-dropzone?
Upvotes: 0
Views: 1938
Reputation: 314
Just pass more <input's />
as childs to Dropzone like:
<Dropzone
onDrop={(onDropProps) =>
console.log("onDropProps in onDrop event handler", onDropProps)
}
accept='image/jpg,image/jpeg,image/png'
multiple={true}
>
{({ getRootProps, getInputProps, isDragActive }) => {
console.log("getRootProps", getRootProps());
console.log("getInputProps", getInputProps());
console.log("isDragActive", isDragActive);
return (
<div>
<div {...getRootProps()}>
<input {...getInputProps()} />
{<p className='fileDrop'>Try dropping one or more files here</p>}
</div>
<div {...getRootProps()}>
<input {...getInputProps()} />
{<p className='fileDrop'>Try dropping one or more files here</p>}
</div>
<div {...getRootProps()}>
<input {...getInputProps()} />
{<p className='fileDrop'>Try dropping one or more files here</p>}
</div>
</div>
);
}}
</Dropzone>
I am using Dropzone on a collapsable table, so when I collapse a row I'll get access to all three props like
Upvotes: 0