vue-dropzone
vue-dropzone copied to clipboard
Setting dropzone element to document.body
Hi,
Is there an option to set the dropzone element to document.body(or any other dom element using id/class) so drop anywhere is supported?
// https://github.com/rowanwins/vue-dropzone/blob/237ccc7a562bd5a218c8370c301d9f654796bed9/src/components/vue-dropzone.vue#L189
// when Dropzone is initialized it seems to set it always to a child element
this.dropzone = new Dropzone(this.$refs.dropzoneElement, this.dropzoneSettings)
This is an example using Dropzone without vue-dropzone: https://github.com/enyo/dropzone/wiki/Make-the-whole-body-a-dropzone
Hmm unfortunately that's not currently possible with this component and I highly doubt we'd ever support it given that it's such a specific use case, but I'll give it a bit of thought before I close the issue
It would be very nice to see this implemented as it's a common feature on file uploaders. On vanilla dropzone you can achieve this by passing the element you want dropzone to attach to as the first parameter like @bruno-fernandes mentioned.
@rowanwins Drag & Drop support on page body is a must have... see google photos. Much better user experience! Just pass the body element as first parameter to dropzone...
@rowanwins Just allow us to set this line as document.body, and its fixed.
Example: https://www.dropzonejs.com/bootstrap.html