GrapesJS / grapesjs

Free and Open source Web Builder Framework. Next generation tool for building templates without coding
https://grapesjs.com
BSD 3-Clause "New" or "Revised" License
22.36k stars 4.05k forks source link

[Bug]: Starting editor "fromElement" creates components inside tag with data-gjs-type="text" #2807

Closed alesub closed 1 year ago

alesub commented 4 years ago

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!

alesub commented 4 years ago

@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!

alesub commented 4 years ago

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!

artf commented 1 year ago

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