diff --git a/com.twin.app.shoptime/src/index.js b/com.twin.app.shoptime/src/index.js index 631ff3e1..49c84d91 100644 --- a/com.twin.app.shoptime/src/index.js +++ b/com.twin.app.shoptime/src/index.js @@ -13,6 +13,18 @@ let appElement = ( ); if (typeof window === "object") { + if (!window.Element.prototype.closest) { + window.Element.prototype.closest = function(selector) { + var element = this; + while (element) { + if (element.matches(selector)) { + return element; + } + element = element.parentElement; + } + return null; + }; + } window.store = store; render(appElement, document.getElementById("root"));