@mschop/alpine-web-components 1.0.2 → 1.0.3
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/AlpineWebComponent.ts +11 -1
- package/package.json +1 -1
package/AlpineWebComponent.ts
CHANGED
|
@@ -104,7 +104,17 @@ abstract class AlpineWebComponent extends HTMLElement {
|
|
|
104
104
|
this.constructor.observedAttributes?.forEach((key: string) => {
|
|
105
105
|
const value = this.getAttribute(key);
|
|
106
106
|
|
|
107
|
-
this.state.attributes[key]
|
|
107
|
+
if (value === null && this.state.attributes[key] !== undefined) {
|
|
108
|
+
const attribute = this.castToAttribute(
|
|
109
|
+
key,
|
|
110
|
+
this.castToAttribute(key, this.state.attributes[key])
|
|
111
|
+
);
|
|
112
|
+
if (attribute !== null) {
|
|
113
|
+
this.setAttribute(key, attribute)
|
|
114
|
+
}
|
|
115
|
+
} else {
|
|
116
|
+
this.state.attributes[key] = this.castFromAttribute(key, value)
|
|
117
|
+
}
|
|
108
118
|
})
|
|
109
119
|
}
|
|
110
120
|
|