diff --git a/snippets/shx-product-desc.liquid b/snippets/shx-product-desc.liquid index da41c37..e9928bc 100644 --- a/snippets/shx-product-desc.liquid +++ b/snippets/shx-product-desc.liquid @@ -108,14 +108,19 @@ } class CustomVariantDescriptionElement extends HTMLElement { + static get observedAttributes() { return ['class', 'style', 'id']; } // Add any other attributes you want to observe + constructor() { super(); this.style.display = 'block'; // "variant" is the id of the variant - this.variant = this.getAttribute('variant'); this.currentVariant = null; + } + + attributeChangedCallback(name, oldValue, newValue) { + this.removeAttribute(name); } initVariantDescription(id) {