@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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/fntags.mjs +7 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@srfnstack/fntags",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "author": "Robert Kempton <r@snow87.com>",
5
5
  "private": false,
6
6
  "homepage": "https://github.com/srfnstack/fntags",
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