[Question] Determine why 'block:drag' event won't fire
Question
My company uses GWT (Google Web Toolkit) to develop some web applications. We have a stand alone GWT component library for our re-usable components. I created a component that wraps grapesjs and it works great.
However, when I import this library into an actual project and add the grapes editor to a screen, everything works fine except dragging blocks onto the canvas. After diving into the grapesjs code, I found that BlockView::handleDrag() is not being called. BlockView::handleDragStart() does get called however. BlockView::handleDragEnd() also does not get called.
Is there some way I can possibly check what would stop the drag event from firing? This is the only code in the handleDrag() function:
handleDrag(ev) {
this.em.trigger('block:drag', this.model, ev);
},
So it seems that Backbone is not publishing the actual browser drag event.
Thanks!
Answers (3)
Thank you for that information. However, in my case this was not working due to this in the index.html:
<body ondragstart="return false;" ondrop="return false;">
</body>
Removing these attributes resolved my issue.
@Troncoso can you provide a fiddle to reproduce this?
Well, no, not likely. Not only is GWT a Java framework, but I have grapesjs working in one GWT project but not another. I imagine this will likely get closed, but I was hoping that posting it as a question might net me some suggestions. This is something I'll have to figure out, but I was looking for some help on how I can troubleshoot grapes events.
Related Questions and Answers
Continue research with similar issue discussions.
Issue #1906
Components & Js - Load Template
Hey, I have a component which has a JS attached to it. Everything is created using the JS. When I drag and drop my block for the first time...
Issue #1875
[QUESTION] ID changes when importing html or passing html in components prop in config.
Hi, I built a component and block that I can drag and drop in the canvas. My issue is that some styles rely on the ID. I know this might no...
Issue #2007
[QUESTION] Adding new traits to component and update current ones with these
I have some custom components created before modifying their traits (for example, I created a new trait for it), these components wont cont...
Issue #3292
QUESTION: Is there a event per component before save which the component can listen to?
Much grateful to you for this library. Background: I am building an editor where I intend to define most of the components from an existing...
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.