Issue #507Opened November 12, 2017by roytang0 reactions

uploadFile being called twice on drop file?

Question

I have an editor initialized as so:

    var editor = grapesjs.init({
      height: '100%',
      container : '#gjs',
      components: '',
      fromElement: true,
      clearOnRender: true,
      style: '.txt-red{color: red}',
      noticeOnUnload: false,
      plugins: ['gjs-blocks-basic'],
      assetManager: {
        upload: "",
        uploadFile: function(e) { console.log("uploadFile"); },
        embedAsBase64: false,
        disableUpload: false
      }    
    });

If I add an image to the canvas and try to upload a new image by dragging it into the drop area in the modal, the uploadFile function is called twice. Uploading by clicking on the upload area and selecting a file from the windows dialog works fine, it only calls the function once.

Answers (3)

duskhackerNovember 19, 20170 reactions

@roytang Explicitly disabling the full-width editor dropzone (dropzone: 0) fixed this for me. Using version 0.12.30

kickbkNovember 23, 20170 reactions

Got the same and @roytang's comment is true, disabling dropzone takes care of it. always using the latest version of course.

Related Questions and Answers

Continue research with similar issue discussions.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.