@mschop/alpine-web-components 1.0.7 → 1.0.9

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.
@@ -104,7 +104,7 @@ abstract class AlpineWebComponent extends HTMLElement {
104
104
  this.constructor.observedAttributes?.forEach((key: string) => {
105
105
  const value = this.getAttribute(key);
106
106
 
107
- if (value === null && this.state.attributes[key] !== undefined) {
107
+ if (value === null && this.state.attributes[key] !== undefined && this.state.attributes[key] !== null) {
108
108
  const attribute = this.castToAttribute(
109
109
  key,
110
110
  this.state.attributes[key],
@@ -146,12 +146,12 @@ abstract class AlpineWebComponent extends HTMLElement {
146
146
  if (newValue === null) {
147
147
  this.removeAttribute(key)
148
148
  } else {
149
- this.setAttribute(key, this.state.attributes[key])
149
+ this.setAttribute(key, newValue)
150
150
  }
151
151
  this.dispatchEvent(
152
152
  new CustomEvent(
153
153
  'updated-' + key,
154
- {detail: {key: key, value: this.state.attributes[key]}},
154
+ {detail: {key: key, value: newValue}},
155
155
  )
156
156
  )
157
157
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mschop/alpine-web-components",
3
- "version": "1.0.7",
3
+ "version": "1.0.9",
4
4
  "description": "Use alpinejs with web components and shadow root",
5
5
  "main": "index.js",
6
6
  "scripts": {