I'm using an HTML Element block and adding "class" as an attribute and setting a value for that attribute.
On the webpage, this is what appears:
<custom-element data-advancedhtml classname="...." ...
Why does it not set the "class" attribute on the element? Instead, it sets what appears to me to be a useless attribute of "classname". My intended use here is to apply a css style to the custom-element via a css class. But "classname" does not seem to accomplish that goal.
Hello @Wayne Fincher
I have checked my side so its working fine for me
please check below oml file
I hope this helps
Thanks
Thank you @Rupesh Patil for taking the time to make that OML. It does help to possibly narrow down the issue to me using OutSystems UI 2.17. I noticed that the OML you shared is using 2.19. Having looked through the release notes for OutSystems UI 2.17 - 2.19, I am not seeing where this was mentioned as an issue.
Please add HTML element block inside the container and add the class to container
like that
That is a good suggestion @Rupesh Patil. I'm actually jettisoning the HTML Element widget entirely and just using Container, with the style applied as you showed.
Both are good workarounds. This leaves an open question as to why this is happening, though. Perhaps it is something besides the OutSystems UI version?
Hi @Wayne Fincher ,
Firstly, I want to ask why you are creating custom html tag? That is not a good practice though and it is suggested to use the already valid tags and customize their look and feel via css.
Anyway, as for why "class" attribute changes to "classname" on non-standard html tags, I cannot say for certain why. I tried with valid/standard tags and it remains as "class". I also tried using both class and classname in that custom-element but only classname was rendered.
I assume it is probably in the OutSystems algorithm when the tag is rendered. I would also say it is somehow a good thing to prevent developers from using tags other than the standard ones. :D
Regards,
Bryan
Thanks for your remarks, Bryan. But with all due respect, who says it is not good practice and who suggests not to use it? I reject both of those based on the following:
https://html.spec.whatwg.org/multipage/custom-elements.html#custom-elements
But, we're off topic here because your post does not help answer the question I posed.