From a3929221930e608b5a08f30d320d4e61831df30c Mon Sep 17 00:00:00 2001 From: Tiberiu Dumitru Date: Sun, 1 Dec 2024 19:07:53 +0200 Subject: [PATCH] OEL-3552: Fixed js accessible case. [skip chromatic] --- .../default/src/js/accessible-toggle/accessible-toggle.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/themes/default/src/js/accessible-toggle/accessible-toggle.js b/src/themes/default/src/js/accessible-toggle/accessible-toggle.js index fa776c69f..1264963f8 100644 --- a/src/themes/default/src/js/accessible-toggle/accessible-toggle.js +++ b/src/themes/default/src/js/accessible-toggle/accessible-toggle.js @@ -15,7 +15,14 @@ class AccessibleToggle { this.type = type; const target = triggerElement.getAttribute("data-bs-target") || triggerElement.getAttribute("href"); + if (!target || target === "#") { + return; + } + this.targetElement = SelectorEngine.findOne(target); + if (!this.targetElement) { + return; + } if (this.type === "modal") { this.instance = Modal.getOrCreateInstance(this.targetElement);