Issue #3211✓ SolvedOpened December 29, 2020by alemenciones3 reactions

How to move components

Quick answerby artf3

Probably it makes sense to add a new component.move(desComponent, opts) method to cover such a case, but for now you can achieve it in this way:

Read full answer below ↓

Question

Hello dear:

I want move a component to first/end in the wrapper programmatically, i think something like editor.getWrapper().add(editor.selectedComponent(), {at: 0});, but this's adding a new clone from selectedComponent,

maybe with trigger "sorter:drag:end" at position??

can you help me?

sorry for my poor english :')

Answers (2)

👍 Most helpfulartfDecember 31, 2020

Probably it makes sense to add a new component.move(desComponent, opts) method to cover such a case, but for now you can achieve it in this way:

GJSBlockMay 17, 2026

Thanks for reporting this, @alemenciones. Great question about how to move components. The recommended approach with ProseMirror is to use the event-driven API. Start here: Check the GrapesJS documentation for your specific module Look for the on() event listener method Most operations can be achie...

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.