File failed to add will stay in the input element #622

Open
opened 2017-02-07 03:43:31 +00:00 by AnthonyTsang · 2 comments
AnthonyTsang commented 2017-02-07 03:43:31 +00:00 (Migrated from github.com)

The problem is that, if we choose a file that is not able to be added into the queue (not passing filters) and onWhenAddingFileFailed() is called as expected. However, if we immediately choose the same file, onWhenAddingFileFailed() will not be called again.

The reason behind is, after the first selection, the selected file is set to be the value of of the original <input type="file">. After onWhenAddingFileFailed() is called, the value of the input element will not be cleared. Thus if we open the file selector and choose the same file, 'onchange' event will not fired again. And addToQueue() will not be called.

The problem is that, if we choose a file that is not able to be added into the queue (not passing filters) and `onWhenAddingFileFailed()` is called as expected. However, if we immediately choose the same file, `onWhenAddingFileFailed()` will not be called again. The reason behind is, after the first selection, the selected file is set to be the value of of the original `<input type="file">`. After `onWhenAddingFileFailed()` is called, the value of the input element will not be cleared. Thus if we open the file selector and choose the same file, 'onchange' event will not fired again. And `addToQueue()` will not be called.
sreedharbukya commented 2017-11-14 11:56:10 +00:00 (Migrated from github.com)

I also have same issue. +1

I also have same issue. +1
koenvanderlinden commented 2018-03-29 13:58:09 +00:00 (Migrated from github.com)

I think this is fixed. Tested on Chrome using the file-select directive.
onWhenAddingFileFailed() is called every time with rejected file based on filter method.

I think this is fixed. Tested on Chrome using the file-select directive. onWhenAddingFileFailed() is called every time with rejected file based on filter method.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: dc/ng2-file-upload#622