Issue #5523💬 AnsweredOpened November 18, 2023by lexoyo0 reactions

Paste when nothing is selected

Quick answerby lexoyo

Note that this bug makes it impossible to copy paste elements to an empty page

Read full answer below ↓

Question

GrapesJS version [X] I confirm to use the latest version of GrapesJS What browser are you using? Firefox Reproducible demo link https://grapesjs.com/demo.html Describe the bug How to reproduce the bug?Select a component on stageCopy the component with CTRL+cSelect the body (deselect the component)Paste with CTRL+v What is the expected behavior? Paste in the current page, at the end of the body What is the current behavior? It does nothing because of this condition: https://github.com/GrapesJS/grapesjs/blob/8025b95a645907574389e950f32950190ceb602c/src/commands/view/PasteComponent.ts#L14Code of...

Answers (2)

lexoyoNovember 18, 2023

Note that this bug makes it impossible to copy paste elements to an empty page

GJS HelperMay 17, 2026

The issue you've described is a known behavior in GrapesJS's default paste-component command. The root cause lies in the command's implementation, specifically the condition if (!selected || !selected.length) return; at the beginning of its run method. This check prevents the paste operation from p...

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.