Vue-dropzone: vdropzone-removed-file fires when you close a modal that has a dropzone

Created on 12 Oct 2017  路  5Comments  路  Source: rowanwins/vue-dropzone

  • Vue2-dropzone Version: 5.2.0
  • Node Version 8.6.0
  • NPM Version 5.4.2
  • OS: osX

Description:

        <dropzone
          id="flightEditUploader"
          ref="flightFilesUpload"
          :url="asset_upload_url"
          :preview-template="template"
          :autoProcessQueue="true"
          :useFontAwesome="true"
          :maxFileSizeInMB="500"
          v-on:vdropzone-success="showSuccess"
          v-on:vdropzone-removed-file="removeAssetFromFlight">
        </dropzone>

This is on modal that when i hit close triggers something like this.$modal.close('modal')

Everytime i hit close i see removeAssetFromFlight triggering removing all assets from my object.

Most helpful comment

In version 3 I will include a prop that lets people set whether the dropzone will be destroyed or not when the component is removed.

All 5 comments

I think this is due to this.$modal.close('modal') triggers the destroy event of Vue on vue2-dropzone, which call the default destroy event of dropzonejs that removes all files

beforeDestroy () {
    this.dropzone.destroy();
}

In version 3 I will include a prop that lets people set whether the dropzone will be destroyed or not when the component is removed.

good afternoon, is there a way to stop this event?

Thank you

Any updates on this?

Hi,

For those who are looking for this, you can add the prop destroyDropzone to avoid the call of destroy :
<vue-dropzone :destroy-dropzone="false" ...>

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jd-0001 picture jd-0001  路  5Comments

ServerJunge picture ServerJunge  路  5Comments

syrex88 picture syrex88  路  6Comments

vesper8 picture vesper8  路  4Comments

yhosun picture yhosun  路  5Comments