As title states - if you rename an elements ID, a class of the same value gets added. Removing custom ID also removes class. Class is not available in the dropdown.
Not sure if this is a bug due to it being in a query loop etc. It’s not for an actual use case due to duplicated ID’s but used it quick for another bug report and noticed it.
It’s needed for the styles to be added that have been added to the ID, because the IDs are removed inside a query loop so they move over to the class.
Hey Dan,
It actually has something to do with the query loop.
An ID is unique and can only be used once. A loop would therefore repeat it x times. To get around this, the ID is converted into a class and everything conforms to the rules
Can we have an option to disable this behavior or allow for an exception when using dynamic data to set the ID?
I tried to use dynamic data to add the ID, and now I have both an ID and a class of the same name; I only need the ID, not the class as I don’t have styles applied to the element.
It wouldn’t comply with the rules if the ID were duplicating, but as I mentioned, dynamic data makes for unique IDs. I label my sections with the IDs and use those IDs to create a dynamic TOC. It works great, but now I have CSS classes that aren’t being used. Could we then at least have these classes be used in place of the auto-generated classes from the loop?
Ok. So there is no problem, except that the loop classes are still output, even though they don’t contain any styles in your case? I don’t think that’s an actual issue, as usually, they do contain styles But maybe I haven’t entirely understood the problem yet… sorry
I just like keeping a clean code output if I can. Here is an example output…notice how the loop class is added–that is the ID being class-ifyed across the repeated elements-- and the masked ID is also class-ifyed so now I have two classes that are not actually
being used (the div is a wrapper for the query loop).
Unfortunately, there’s no way to avoid that—it’s how the query loop works. It takes the original element ID (#brxe-wbypeu) and converts it to a class to avoid duplicate IDs.