Issue #3166πŸ’¬ AnsweredOpened Dec 1, 2020by nanaya10 reactions

Problem with copy and paste a node

Quick answerby artf

I've tried locally but the node is placed correctly. Are you able to create a live demo, please?

Read full answer below ↓

Question

*Version:0.16.27 Are you able to reproduce the bug from the demo? [ ] Yes [ ] No What is the expected behavior? In the right panel and canvas, the pasted node should be after the copied node. What is the current behavior? I copy a node. In the views-container(right panel), the pasted node is after the copied node. But in the canvas, the pasted node is before the copied node. As shown below: Describe the bug detailed This bug occurs when there are spaces or carriage returns between html tags. Because in the β€˜grapesjs/src/dom_components/view/ComponentsView.jsβ€™οΌŒaddToCollection Method uses js chi...

Answers (4)

artfβ€’ Dec 1, 2020

I've tried locally but the node is placed correctly. Are you able to create a live demo, please?

nanaya1β€’ Dec 2, 2020

Sorry, I did not elaborate on the scenario where this error occurred. The components that come with grapesjs do not produce this error, because they donβ€˜t have spaces,carriage returns or tabs. I found this problem while customizing components. I have customized a lot of my own components, and some...

nanaya1β€’ Dec 3, 2020

@artf I accidentally closed the issue.

GJSBlockβ€’ May 17, 2026

Thanks for reporting this, @nanaya1. The issue with Problem with copy and paste a node appears to be a race condition or state management timing problem. This typically happens when component lifecycle events and DOM modifications overlap, creating an inconsistent state. What to try: Add a setTimeo...

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.