From 2a1f97afb3fa01e33b6c1510c596c1113830aff6 Mon Sep 17 00:00:00 2001 From: yonghyon Date: Thu, 1 Feb 2024 10:57:14 +0900 Subject: [PATCH] redefine closest func --- com.twin.app.shoptime/src/index.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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"));