BUG: Style gone on link or nested text elements after exiting edit
Question
Hello,
I am editing legacy HTML with version 0.16.3 + newsleter-plugin. The style is stored inline (since the tool is used for authoring emails) and I use the feature componentFirst: true .
I am facing a problem when trying to edit Component Text that has other text elements inside.
<div style="font-size: 20px;" class="my-class" >
A text component
<span style="font-size: 35px;">---and a text inside---</span>
</div>
Once I edit the text from the parent div, the styling of the nested element disappears at blur. The inline style is stored on the id and the id of the subnode is completely removed.
How can I stop this from happening?
The behavior is presented in this JSFiddle: https://jsfiddle.net/jsh8yv4p/
I have read about including the text inside the parent div in a span or another text element, but since the HTML that is loaded in the editor is legacy I do not want to alter its structure in this manner.
Is there any way I can edit text(that might have subnodes) and not alter the subnodes?
Thank you in advance, Lavinia
Answers (3)
Hi @orosl, thanks for the report. I was able to find and fix the bug so, it'll be available in the next release.
Hi @artf, thank you very much for your prompt response and release. I upgraded with the latest version 0.16.27. However I still encounter the problem, but with a slightly different behavior.
I am not sure if I should open a new issue since it is partially solved but nonetheless, I will explain the behavior here.
Given a similar configuration as above and presented in this demo: https://jsfiddle.net/x5srzpvk/5
If I change the styling of the link(or any other such element) in the nested span element, after an edit, the styling is lost since the id is altered (styling is kept on the id).
So, id: jp365 transforms into jp365-2 and continues to be added -2-2 after each edit. I encountered this behavior in multiple similar situations. Also, the HTML gets difficult to read after many edits, as the ids increase in size.
Is there any way I can stop the process of altering ids of subnodes if text is edited?
Thank you and much appreciation, Lavinia
Thanks @orosl actually the fix was working with inner components but not with nested ones. I'll fix it in the next release
Related Questions and Answers
Continue research with similar issue discussions.
Issue #2771
[BUG] component with textable:1 not working since version 0.16.12
Hello, I've just updated to the lasted version 0.16.12 and have a bug when trying to move a component that has the property textable:1 into...
Issue #4310
BUG: Style Manager is inaccurate when using combined CSS selectors which contains "bout" and componentFirst = true
GrapesJS version [X] I confirm to use the latest version of GrapesJS What browser are you using? Chrome 100 Reproducible demo link https://...
Issue #3579
BUG: RTE misplaced when opened right after dropping `activeOnRender` component
Version: 0.17.4 Are you able to reproduce the bug from the demo?[x] Yes[ ] No Steps to reproduce:Go to the demoDrop a "Text" block inside t...
Issue #2697
[QUESTION] Problem with custom component type and table cell
Hello! I'm trying to add custom component type: And also I'm adding new block: But when I drop this block on the canvas the <td> tag doesn'...
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.