Add option for hidden input field container selector #1044
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I'm using Dropzone on a webapp with Turbolinks 3 architecture (https://github.com/rails/turbolinks). It means that when navigating through links - new HTML is fetched and body is replaced with JS. But also, it is possible to keep some of the DOM nodes in that process so they are permanent.
Basically, I want to initialize Dropzone once and have the uploads active while I'm navigating through my app. To do that, I need to place hidden file input in the "permanent" container and not directly into the body. Otherwise, every Turbolinks body change would remove the hidden input and disable Dropzone from working.
This commit fixed my issue. The change is simple and doesn't interfere in any way with other parts of Dropzone - so it would be great if it can be merged into original repo.