ngx-dropzone icon indicating copy to clipboard operation
ngx-dropzone copied to clipboard

ngx-dropzone property [multiple] is not working

Open TonyGolem opened this issue 3 years ago • 2 comments

Hi,

the property [multiple]="false" is not working,

the code:

image

the result:

image

Angular CLI: 13.3.7 Node: 16.15.0 Package Manager: npm 7.5.6 OS: win32 x64 "ngx-dropzone": "^3.1.0"

TonyGolem avatar Jul 11 '22 16:07 TonyGolem

Hey there, please show the code of your onSelect method.

peterfreeman avatar Jul 20 '22 20:07 peterfreeman

Hi,

sure, here is my onSelect method.

image

I took it from the readme.md of the repository

Sorry, I accidentally closed the problem...

TonyGolem avatar Jul 22 '22 16:07 TonyGolem

Setting the multiple property to false only limits the number of files per drop/selection to 1. If you always only want to show a single file, you have to implement this in your onSelect method. In your case, you simply push all files to the this.files array and render them in the component, which will of course stack up to more than one file.

peterfreeman avatar Oct 18 '22 11:10 peterfreeman