Issue #5175๐Ÿ’ฌ AnsweredOpened Jun 10, 2023by krishnaeverestengineering0 reactions

Move method is not working as expected

Quick answerby krishnaeverestengineering

Fix for this issue: https://github.com/GrapesJS/grapesjs/pull/5176

Read full answer below โ†“

Question

GrapesJS version [X] I confirm to use the latest version of GrapesJS What browser are you using? Chrome Reproducible demo link https://codesandbox.io/s/adoring-margulis-873kdv Describe the bug Context Move component method doesn't work as expected. This piece of code doesn't work as expected. this piece of code should work. When sameParent is false and target index is 1, then it won't move to 0 to 1 position for exampleCode of Conduct [X] I agree to follow this project's Code of Conduct

Answers (4)

artfโ€ข Jun 15, 2023

Thanks @krishnaeverestengineering but this is actually the expected behaviour for moving the component inside the same parent. This is because the at should account also for the index of the component itself. So, if you try to move "Component 1" at index 0 or 1, nothing will happen. If you need to...

krishnaeverestengineeringโ€ข Jun 15, 2023

Thanks @krishnaeverestengineering but this is actually the expected behaviour for moving the component inside the same parent. This is because the at should account also for the index of the component itself. So, if you try to move "Component 1" at index 0 or 1, nothing will happen. If you need to...

GJS Helperโ€ข May 17, 2026

You've identified a critical bug in the GrapesJS Component.prototype.move method. The current implementation contains two main issues that lead to incorrect component placement and, in some cases, prevent components from moving at all, especially when moving within the same parent. Root Cause Analy...

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.