felixrieseberg / felixrieseberg/React-Dropzone-Component
no-url and autoProcessQueue may be conflicting
- Dominant language
- JavaScript
- Stars
- 999
- Forks
- 148
- PR merge metrics
- No merged PRs in 30d
Description
Hi,
# Problem
Looking at the README section for [Usage Without Automatic Posting](https://github.com/felixrieseberg/React-Dropzone-Component#usage-without-automatic-posting), along with the usage of ```postUrl: no-url```, my understanding was that I could simply POST the files using a separate mechanism. Or, in my own case, just use it as a file browser without POSTing at all.
However, not calling ```dropzone.processQueue()``` would mean that the empty progress bar overlay would be over the thumbnails indefinitely. It wasn't until I explicitly called ```processQueue()``` to a valid POST endpoint that the progress bar "completed" and was replaced with the check mark.
# Investigation
However, looking through the [comments in dropzonejs code](https://github.com/enyo/dropzone/blob/master/src/dropzone.coffee#L183) and the dropzone [documentation on enqueue files](http://www.dropzonejs.com/#enqueuing-file-uploads), it appears that ```autoProcessQueue: false``` is simply a mechanism to delay the POST until a future time. Perhaps via button, or some other user-triggered event.
With this in mind, I believe the ```postUrl: 'no-url'``` will not have the intended behavior as dropzone appears to expect. [This check](https://github.com/felixrieseberg/React-Dropzone-Component/blob/master/lib/react-dropzone.js#L54) in ```react-dropzone.js``` also suggests that a postUrl or drop/init event handler is necessary. If anything, the ```postUrl: 'no-url'``` assignment appears to be a workaround for this.
# Resolution?
I have a branch [here](https://github.com/ko/React-Dropzone-Component/tree/autoprocessqueue) with [the following commit](https://github.com/ko/React-Dropzone-Component/commit/24ff695fb8f02b6655e0c4d2943e8a1fad8992c0) to act as an example. Rather than a pull request, I figure this may require some discussion due to the scope of the potential change.
Thanks,
Ken
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the README's “Usage Without Automatic Posting” section and the check in lib/react-dropzone.js, then compare the linked Dropzone.js enqueue documentation with the example branch and commit. Determine the intended interaction between postUrl: 'no-url' and autoProcessQueue: false; done means the component supports file browsing or externally handled uploads without leaving the progress overlay indefinitely.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100