Text disappears if pasted for a second time in text block
@artf The problem is relevant to the latest version. (v0.19.4) The bug occurs if you copy and paste a nested component while editing text. A regular paste (cmd + v) copies all html, including id, and after removing focus, html with identical id is deleted.
Read full answer below โQuestion
GrapesJS version [X] I confirm to use the latest version of GrapesJS What browser are you using? Chrome 99 Reproducible demo link https://grapesjs.com/demo.html Describe the bug How to reproduce the bug?Open https://grapesjs.com/demo.html and delete all sample sectionsPlace one "Text section"Open a text editor and type 3 lines of text. Something like this:Copy the 3 lines from the text editorGo back to GrapesJS demo page and double click the text section just before the word consecterur (other word would work too)Press CTRL+V to paste the textClick outside to commit the changesHover your mous...
Answers (4)
@artf The problem is relevant to the latest version. (v0.19.4)
The bug occurs if you copy and paste a nested component while editing text. A regular paste (cmd + v) copies all html, including id, and after removing focus, html with identical id is deleted.
I can confirm that this problem occurs only with Grapesjs 0.18.3 - I downgraded to 0.18.2 and the problem does not occur. Older versions are OK too.
I can confirm that this problem occurs only with Grapesjs 0.18.3 - I downgraded to 0.18.2 and the problem does not occur. Older versions are OK too.
in version 0.18.2, nested components were not created inside the text.
Thanks for reporting this, @varadero. Great question about Text disappears if pasted for a second time in text block. The recommended approach with GrapesJS is to use the event-driven API. Start here: Check the GrapesJS documentation for your specific module Look for the on() event listener method...
Related Questions and Answers
Continue research with similar issue discussions.
Issue #5729
Editing/replacing the text inside of a link
GrapesJS version [X] I confirm to use the latest version of GrapesJS What browser are you using? Chrome v122 Reproducible demo link https:/...
Issue #5378
Uncaught TypeError: Cannot read properties of undefined (reading 'Canvas') while dragging a component in Layer Manager Panel
GrapesJS version [X] I confirm to use the latest version of GrapesJS What browser are you using? Chrome v116.0.5845.97 Reproducible demo li...
Issue #4249
Image src won't change in exported HTML
GrapesJS version [X] I confirm to use the latest version of GrapesJS What browser are you using? chrome 100 Reproducible demo link https://...
Issue #6348
It's possible to drag and drop literally anything inside grapesjs canvas
GrapesJS version [X] I confirm to use the latest version of GrapesJS What browser are you using? Chrome Reproducible demo link https://grap...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.
Browse free plugins โ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.
Tutorial
How to Build a Production GrapesJS Editor: The Complete Walkthrough of Brief, Preset, Plugins, and Services
A complete walkthrough of building a production GrapesJS editor: how to choose a preset, pick plugins, and scope setup services without burning a sprint.
Tutorial
Big Updates: TinyMCE 8 and Placeholder 2.0 for GrapesJS
In May we shipped major updates to two of our most popular GrapesJS plugins โ TinyMCE Inline Text Editor and Placeholder.
Tutorial
Find the Right GrapesJS Plugin in Seconds: Smarter Discovery Is Live
We're shipping a set of discovery upgrades. New label filters, a proper compatibility switch for GrapesJS vs Studio, one-click and a smarter sort bar.
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.