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

Created on 14 Feb 2018  路  7Comments  路  Source: artf/grapesjs

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

Most helpful comment

@japo32 all available public events are documented here: https://grapesjs.com/docs/api/editor.html#available-events

All 7 comments

Thanks for the catch James, I'll fix it for the next release

hi,
When is the next release? Is it possible for us to fix it on our end before the release? We are seeing this issue now and our release goes out in 2 weeks.

thank you
ca

@lv-alex I planned to release for the end of this week

thank you @artf . We will try it out

It works. Thank you @artf

Is this anywhere in the new documentation? I can't seem to find any reference to component:add

@japo32 all available public events are documented here: https://grapesjs.com/docs/api/editor.html#available-events

Was this page helpful?
0 / 5 - 0 ratings

Related issues

applibs picture applibs  路  3Comments

adam-gpc picture adam-gpc  路  3Comments

mathiasbc picture mathiasbc  路  3Comments

YashPrince picture YashPrince  路  3Comments

faizansaiyed picture faizansaiyed  路  3Comments