Issue #826💬 AnsweredOpened February 1, 2018by maxtacco0 reactions

Element auto generated id not added back after custom id is used and then cleared

Quick answerby maxtacco

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: () => {}.

Read full answer below ↓

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...

Answers (1)

maxtaccoFebruary 1, 2018

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.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Free option

Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.

Browse free plugins →
Premium option

Premium plugins ship with support, regular updates, and production-ready features — save days of integration work.

Browse premium plugins →

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.