Why Text element converted into box ??
Question
Hi @artf ,
I am using grapesjs newsletter plugin with ckeditor plugin. I dragged TEXT element in canvas and did some editing with ckeditor. i have connected it to database. when ever i save content in database after reloding the editor i set content value from database field and after that TEXT element get converted into BOX. dont know why TEXT element is changing to BOX and also ckeditor in not loading in that BOX element ?? Please help me out in this.

Answers (3)
@Siddharth-ss42279 If you need to EDIT the template created from GrapesJS, you SHOULD NOT USE ITS HTML.... you should import its JSON... so you're doing it WRONG
It's like doing this
el.addEventListener('click', ...);
someOtheEl.innerHTML = el.innerHTML;
and then complaining why your el doesn't have click listener anymore... you're just ripping off all the information created by the editor.
What do you store in your database? The HTML and CSS?
Hi @artf
Actually, i get in-lined html using command editor.Commands.get('gjs-get-inline-html').run(editor) and saving it to database and for rendering content i am using editor.setComponent(content_field)
problem is when i render content from database the TEXT element gets converted into BOX element (only when i edit some text in that text element using ckeditor) and in BOX element ckeditor in not loading.
Either one of the below can solve my problem :
- TEXT element should not get converted into BOX
- or, BOX element should load ckeditor
step to replicate the issue in grapesjs newsletter demo:
- goto: https://grapesjs.com/demo-newsletter-editor.html
- drag text element on canvas.
- now select some text in that and apply style, bold and color to that text from ckeditor.
- hover over the text element you will see it still showing the TEXT on the top

- Now copy the code from view code modal.
- again Import that copied code from import button.
observation:
now TEXT element has converted to BOX ????

and ckeditor in not opening in that box.
any help would be appreciated and Thanks.
Related Questions and Answers
Continue research with similar issue discussions.
Issue #1306
Inserting text in an canvas element is not updated on the HTML content after saving it.
H @artf, I have a pitfalls in the middle of saving the HTML content. Right now we have a popup modal dialog where I can select some special...
Issue #1296
Custom Rich Text Editor is not working
Hi @artf, I've just created a custom plugin of the RTE using different libraries like CKEditor 5, TinyMCE 4 or pell but all of them with th...
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...
Issue #1660
Content will automatically removed while edit in editor
Hello @artf I am facing an issue with grapes.js while editing any textual content. I am using grapes.js Version 0.14.37 with angular 1.6.1....
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.