Issue #828💬 AnsweredOpened February 1, 2018by maxtacco0 reactions

Components 'add' event fires different number of times

Quick answerby artf

Hi @maxtacco, unfortunately, this is due to how the Sorter works when moves components and honestly, at the moment, I can't see better workaround than your one

Read full answer below ↓

Question

Hi, I've noticed that if I add the following code in my custom component the event fires differently depending on whether a new child component is drag and dropped from blocks vs canvas. Only one event is fired when I drag and drop a child component from the blocks section. But, when I drag and drop from canvas I can see this event firing twice and the first time some 'div' component is passed. I wonder if this relates to https://github.com/artf/grapesjs/pull/202 or not. Also, I can handle this event the way I want but checking for the avoidStore option of the component: Please let me know if...

Answers (2)

artfFebruary 6, 2018

Hi @maxtacco, unfortunately, this is due to how the Sorter works when moves components and honestly, at the moment, I can't see better workaround than your one

lock[bot]September 18, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

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.