"component:add" event triggers when components are moved
@japo32 all available public events are documented here: https://grapesjs.com/docs/api/editor.html#available-events
Read full answer below ↓Question
Taken from https://github.com/artf/grapesjs/wiki/API-Editorcomponent: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...) Reproducehttps://jsfiddle.net/szLp8h4n/11/Move any of the text components around in the page.An alert will be displayed. --- Great project btw. 👍
Answers (3)
@japo32 all available public events are documented here: https://grapesjs.com/docs/api/editor.html#available-events
Any update on this issue? It still calls component:add event when I simply move a component around.
It works. Thank you @artf
Related Questions and Answers
Continue research with similar issue discussions.
Issue #3235
"component:update" does not trigger when components are moved
Taken from https://github.com/artf/grapesjs/blob/dev/src/editor/index.js#L33 component:update - Triggered when a component is updated (move...
Issue #581
Reading component related events
The Editor API wiki lists a set of component-related events that can be listened to (e.g. component:add, component:update). There is howeve...
Issue #3404
Style Manager Issue.
Hi @artf I want to hide and show style properties for specific component. After referencing this issue https://github.com/artf/grapesjs/iss...
Issue #4735
resetId types mismatch
GrapesJS version [X] I confirm to use the latest version of GrapesJS What browser are you using? n/a Reproducible demo link n/a Describe th...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.
Browse free plugins →Premium plugins ship with support, regular updates, and production-ready features — save days of integration work.
Browse premium plugins →Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.