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)
@roytang I can't reproduce it with the current version https://codesandbox.io/s/p554z8yv7j
@roytang Explicitly disabling the full-width editor dropzone (dropzone: 0) fixed this for me. Using version 0.12.30
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.
Issue #998
[BUG] Asset Manager sends empty request when uploading image
Description: GrapesJS editor is initialized in an editor.html file as follows: localhost:9001 is a local IIS server running PHP5. The conte...
Issue #384
Create and Edit Template into Database
This is my code to Create a new template and insert the inline html with style into the database : I am able to insert the template-data in...
Issue #519
No Blocks by default
Using this code I get an editor but there are no blocks. I also do not get the icons for the screen size but other icons are there. As you...
Issue #1505
adding row and sections not working
i am integrating grapejs with angular6. but it is not working means it is not showing on blocks i am using following code
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.