AckerApple / angular-file

Angular components for user file select, drop, and more
http://ackerapple.github.io/angular-file/
MIT License
128 stars 40 forks source link

"fileDropDisabled" option of "ngf" is not working for file drop. #30

Closed karolis-k closed 5 years ago

karolis-k commented 6 years ago

If I set it to true, it disables, file selection, but not file drop.

I looked at source code and for me it seems that check is missing in ngfDrop event. I think it should be something like this:

  @HostListener('drop', ['$event'])
  onDrop(event:Event):void {
    this.closeDrags()
    // Condition below added:
    if (this.fileDropDisabled){
        return;
    }
    let files = this.eventToFiles(event)

    if(!files.length)return

    this.stopEvent(event);
    this.handleFiles(files)
  }

P.S. naming for this property seems to be not correct, or it should belong to ngfDrop rather than ngf.

AckerApple commented 6 years ago

Will let ya know

dellc64 commented 5 years ago

Hi. Any progress here?

AckerApple commented 5 years ago

If y’all need this, make a pull request. I don’t need it and I’m swamped

AckerApple commented 5 years ago

46 looks great. I’ll merge and deploy no later than Monday. Thank you a lot @dellc64

AckerApple commented 5 years ago

Completed