@openeuropa/bcl-theme-joinup 1.7.0 → 1.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3039,7 +3039,13 @@ class AccessibleToggle {
3039
3039
  this.triggerElement = triggerElement;
3040
3040
  this.type = type;
3041
3041
  const target = triggerElement.getAttribute("data-bs-target") || triggerElement.getAttribute("href");
3042
+ if (!target || target === "#") {
3043
+ return;
3044
+ }
3042
3045
  this.targetElement = SelectorEngine.findOne(target);
3046
+ if (!this.targetElement) {
3047
+ return;
3048
+ }
3043
3049
  if (this.type === "modal") {
3044
3050
  this.instance = Modal.getOrCreateInstance(this.targetElement);
3045
3051
  } else if (this.type === "offcanvas") {