Issue #868Opened February 14, 2018by nojacko5 reactions

[BUG]: "component:add" event triggers when components are moved

Question

Taken from https://github.com/artf/grapesjs/wiki/API-Editor

component:add - Triggered when a new component is added to the editor, the model is passed as an argument to the callback

My understanding is that the component:add should only be called when the block is dragged in from the blocks panel and dropped into the editor. I don't think this should happen when a block is moved around the editor (that's what component:update is for...)

Reproduce

  1. https://jsfiddle.net/szLp8h4n/11/
  2. Move any of the text components around in the page.
  3. An alert will be displayed.

Great project btw. 👍

Answers (3)

seifelhoseinyJuly 12, 20222 reactions

Any update on this issue? It still calls component:add event when I simply move a component around.

lv-alexMarch 22, 20181 reactions

It works. Thank you @artf

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.