peterfreeman / ngx-dropzone

A highly configurable dropzone component for Angular.
133 stars 59 forks source link

ngx-dropzone property [multiple] is not working #153

Closed TonyGolem closed 1 year ago

TonyGolem commented 2 years ago

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"

peterfreeman commented 2 years ago

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

TonyGolem commented 2 years ago

Hi,

sure, here is my onSelect method.

image

I took it from the readme.md of the repository

Sorry, I accidentally closed the problem...

peterfreeman commented 1 year ago

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.