@hortonstudio/main 1.6.3 → 1.6.4

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.
@@ -83,12 +83,9 @@ function setupDynamicDropdowns() {
83
83
  item.setAttribute("tabindex", "0");
84
84
  });
85
85
 
86
- const clickEvent = new MouseEvent("click", {
87
- bubbles: true,
88
- cancelable: true,
89
- view: window,
90
- });
91
- wrapper.dispatchEvent(clickEvent);
86
+ // Trigger Webflow interaction
87
+ const wfIx = Webflow.require("ix3");
88
+ wfIx.emit("navbar_1_dropdown");
92
89
  }
93
90
 
94
91
  function closeDropdown() {
@@ -111,12 +108,9 @@ function setupDynamicDropdowns() {
111
108
  toggle.focus();
112
109
  }
113
110
 
114
- const clickEvent = new MouseEvent("click", {
115
- bubbles: true,
116
- cancelable: true,
117
- view: window,
118
- });
119
- wrapper.dispatchEvent(clickEvent);
111
+ // Trigger Webflow interaction (reverse)
112
+ const wfIx = Webflow.require("ix3");
113
+ wfIx.emit("navbar_1_dropdown");
120
114
  }
121
115
 
122
116
  wrapper.addEventListener("mouseenter", () => {
@@ -244,7 +238,13 @@ function setupDynamicDropdowns() {
244
238
  currentMenuItemIndex = menuItems.length - 1;
245
239
  menuItems[currentMenuItemIndex].focus();
246
240
  } else {
247
- closeDropdown();
241
+ openDropdown();
242
+ if (menuItems.length > 0) {
243
+ setTimeout(() => {
244
+ currentMenuItemIndex = menuItems.length - 1;
245
+ menuItems[currentMenuItemIndex].focus();
246
+ }, 100);
247
+ }
248
248
  }
249
249
  } else if (e.key === "Escape") {
250
250
  e.preventDefault();
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- // Version:1.6.3
1
+ // Version:1.6.4
2
2
 
3
3
  const API_NAME = "hsmain";
4
4
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hortonstudio/main",
3
- "version": "1.6.3",
3
+ "version": "1.6.4",
4
4
  "description": "Animation and utility library for client websites",
5
5
  "main": "index.js",
6
6
  "type": "module",