diff --git a/components.js b/components.js index aded3a7..c52ae45 100644 --- a/components.js +++ b/components.js @@ -1772,6 +1772,8 @@ customElements.define('sm-popup', class extends HTMLElement { constructor() { super() this.attachShadow({ mode: 'open' }).append(smPopup.content.cloneNode(true)) + + this.allowClosing = false } resumeScrolling() { @@ -1783,6 +1785,9 @@ customElements.define('sm-popup', class extends HTMLElement { } show(pinned, popupStack) { + setTimeout(() => { + this.allowClosing = true + }, 300); this.setAttribute('open', '') this.pinned = pinned this.popupStack = popupStack @@ -1791,6 +1796,10 @@ customElements.define('sm-popup', class extends HTMLElement { document.body.setAttribute('style', `overflow: hidden; top: -${window.scrollY}px`) } hide() { + if (!this.allowClosing) return + setTimeout(() => { + this.allowClosing = false + }, 300); this.removeAttribute('open') if (window.innerWidth < 648) { this.popup.style.transform = 'translateY(100%)'; diff --git a/index.html b/index.html index 2a85028..0a47e5c 100644 --- a/index.html +++ b/index.html @@ -74,7 +74,7 @@ *Requires Rupee to be deposited first.

- +