Issue #2393Opened November 8, 2019by troncoso2 reactions

[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)

troncosoNovember 12, 20192 reactions

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.

pouyamiralayiNovember 10, 20190 reactions

@Troncoso can you provide a fiddle to reproduce this?

troncosoNovember 11, 20190 reactions

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.

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.