[Bug]: Starting editor "fromElement" creates components inside tag with data-gjs-type="text"
Question
Hi,
I'm currently trying to start the editor "fromElement", setting the following html inside the container:
<p data-gjs-type="text" contenteditable="true">
Lorem asd dolor sit amet consectetur, adipisicing elit. Similique repellat <b>voluptatum</b>
voluptas ex, esse error sed culpa <i>impedit</i>, <strike>eum amet </strike> laboriosam <strike>.
Doloribus, maxime fuga eum aliquid non doloremque </strike>soluta quod.
</p>
But when executed, grapesjs creates components inside the <p> tag even after setting the data-gjs-type attribute as text. What I'm trying to do is to present the paragraph to be edited as a single component.
You can see the issue in action here: https://codepen.io/alesub/pen/xxwNaPd
Thanks for this great tool!
Answers (3)
@artf just to clarify: this bug is based on the expected behaviour you described on this comment: https://github.com/artf/grapesjs/issues/576#issuecomment-348550694 And how the divs with text behave on the demo page.
Please let me know if I got it wrong, Thank again!
Hi, any luck reviewing this issue? What got me lost is this doesn't happen on the demo page, any bold or italic text doesn't become a separate component after saving or reloading.
Any insight will be greatly appreciated, Thanks!
Closing this one as now this is the default behavior.
There is also a possibility to customize the behavior via disableTextInnerChilds option added from https://github.com/GrapesJS/grapesjs/releases/tag/v0.21.2
Related Questions and Answers
Continue research with similar issue discussions.
Issue #1394
[Bug]: Pasting multiple paragraphs aren't editable until Grapes reloads
https://grapesjs.com/demo.htmlIn the double click into the text "All text blocks could..." to trigger editing mode.Paste this text in: The...
Issue #2707
[BUG] built-in RTE reset styles on rte:disable
Hello, @artf , I've catch a bug at built-in RTE:added standart email text element with a red styled tag a inside:enable rte by doubleclick...
Issue #6202
BUG: Javascript CDN not working on grapejs canvas
GrapesJS version [X] I confirm to use the latest version of GrapesJS What browser are you using? 129 Reproducible demo link https://grapesj...
Issue #460
When the component's view modifies the HTML, text components are no longer editable
I'm trying to build a custom component that contains some lorem ipsum text in the content, for editing once it's on the canvas. But I also...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.