Issue #850💬 AnsweredOpened February 8, 2018by austinbiggs0 reactions

Component:Moved Event

Quick answerby artf

Have you tried with Components-&-JS?

Read full answer below ↓

Question

What I'm trying to accomplish: I have a piece of code I need to run when a component is "dropped". I put "dropped" in quotes, because it needs to fire when the tlb-move ends. So as a user, if I click the Move icon in the toolbar, when I finishing moving the component I need my code to fire. I've tried quite a few events with no success: stop:tlb-move, change:canvasOffset, focus, and move-comp; all with no success. The editor contents I'm loading contain a Flexslider instance (which creates additional markup/element styles) which breaks when the user moves the Flexslider's container. In order...

Answers (3)

maxtaccoApril 14, 2018

Having the same problem - I can't figure out an event on a component to listen for when move ends.

maxtaccoApril 14, 2018

So, the only way I was able to make it reasonably work was to listen for the "selectedComponent" event that is fired in https://github.com/artf/grapesjs/blob/b62e032b06f45382849b59e6a3f32049f0a021fc/src/commands/index.js#L168 in my component model's init() method: It would be really nice if there w...

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...

Free option

Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.

Browse free plugins →
Premium option

Premium plugins ship with support, regular updates, and production-ready features — save days of integration work.

Browse premium plugins →

Related tutorials

In-depth guides on the same topic.

All tutorials →

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.