Issue #5820πŸ’¬ AnsweredOpened Apr 17, 2024by rhoenerSBS0 reactions

Double Entry in Layers if Component is moved directly after add

Quick answerby rhoenerSBS

I initially wanted to realize the same behavior with a function in the droppable property of the parent component to prevent components being dropped at a specific index but unfortunately the index is not given as a param for that function.

Read full answer below ↓

Question

GrapesJS version[X] I confirm to use the latest version of GrapesJSWhat browser are you using? Chrome v123Reproducible demo link https://jsfiddle.net/xwgons8z/Describe the bug I'm trying to programmatically move an added component to a specific position in the parent since I have child components, that are supposed to stay at the last index, but there is a bug in the layers that once the component is moved it has two corresponding entries in the layers panel. How to reproduce the bug?Open FiddleDrop component into canvas at the last position (does not happen here)Drop another component into c...

Answers (2)

rhoenerSBSβ€’ Apr 17, 2024

I initially wanted to realize the same behavior with a function in the droppable property of the parent component to prevent components being dropped at a specific index but unfortunately the index is not given as a param for that function.

GJS Helperβ€’ May 17, 2026

Thank you for reporting this issue. You've identified a subtle timing bug in GrapesJS related to how the Layers panel updates when a component is programmatically moved immediately after being added. Root Cause The issue stems from a timing conflict between the component:add event and the subsequen...

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.