From e23c8c5c99b846f379cdaa73cf02da6a998048b0 Mon Sep 17 00:00:00 2001 From: Jan Umbach Date: Thu, 30 May 2024 13:36:04 +0200 Subject: [PATCH] test --- snippets/shx-product-desc.liquid | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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) {