@srfnstack/fntags 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/fntags.mjs +7 -0
package/package.json
CHANGED
package/src/fntags.mjs
CHANGED
|
@@ -635,6 +635,13 @@ const setAttribute = function (attrName, attr, element) {
|
|
|
635
635
|
for (const style in attr) {
|
|
636
636
|
setStyle(style, attr[style], element)
|
|
637
637
|
}
|
|
638
|
+
} else if (attrName === 'class') {
|
|
639
|
+
//special handling for class to ensure the selector classes from fntemplate don't get overwritten
|
|
640
|
+
if(element.className) {
|
|
641
|
+
element.className += ` ${attr}`
|
|
642
|
+
} else {
|
|
643
|
+
element.className = attr
|
|
644
|
+
}
|
|
638
645
|
} else if (attrName === 'value') {
|
|
639
646
|
element.setAttribute('value', attr)
|
|
640
647
|
// html5 nodes like range don't update unless the value property on the object is set
|