[Bug] Element auto generated id not added back after custom id is used and then cleared
Question
Hi,
I think there is a bug related to the generation of element id attributes.
When modifying element's style the value of the element's id attribute is auto generated and added to the HTML that once can see in the Code editor. Then the id attribute value is updated correctly when Id editor is used in the Settings to specify a custom id. But, once this Id value is cleared the auto generated value is not applied to the element's id attribute anymore. Instead id is set to an empty string (i.e. id="")
I wonder if it has to do with Id trait that doesn't set id to null but instead sets to an empty string when cleared.
Thank you.
Answers (1)
Also, if this is the case would be nice to set the default "empty" value strategy for traits in the configuration of a component. For example, emptyValue: "" or emptyValue: null or emptyValue: () => {}.
Related Questions and Answers
Continue research with similar issue discussions.
Issue #391
Namespace CSS?
Hi there, Is there a way to setup the grapesjs editor such that the CSS generated for the HTML content is namespaced? In other words, how t...
Issue #2383
Custom component not pulling through style on first add.
Fiddle replicating the issue: https://jsfiddle.net/gd8mo3e4/1/ I have a custom component for creating a gallery of pdf documents. There's a...
Issue #1914
[Bug] Change default font size unit to EM instead of REM.
Now in GrapesJS editor, we have some of font sizes in REM. I think they should be in EM unit because if we want to embed editor in the exis...
Issue #2337
[BUG / QUESTION] Deleting default styles does not work
Hello, i'm trying to delete some of the default styles of the blocks. I wrote everything I changed in a plugin. I used this function to upd...
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.