@greghowe79/the-lib 2.12.3 → 2.12.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.
@@ -23,6 +23,7 @@ const NavigationMenu = qwik.component$(({ ariaLabel, logoComponent, listItems, a
23
23
  const renderSearchIcon = (icon) => {
24
24
  return typeof icon === "function" ? icon({}, null, 0) : icon;
25
25
  };
26
+ const searchHref = searchLink?.href ?? "";
26
27
  return /* @__PURE__ */ jsxRuntime.jsx("nav", {
27
28
  class: `menu ${isOpen.value ? "open" : ""}`,
28
29
  "aria-label": ariaLabel,
@@ -109,16 +110,28 @@ const NavigationMenu = qwik.component$(({ ariaLabel, logoComponent, listItems, a
109
110
  href: searchLink.href,
110
111
  class: "search-link",
111
112
  "aria-label": searchLink.ariaLabel ?? "Search Professional",
112
- onClick$: () => {
113
- isOpen.value = false;
113
+ onClick$: (e) => {
114
+ if (isOpen.value) {
115
+ e.preventDefault();
116
+ isOpen.value = false;
117
+ setTimeout(() => {
118
+ window.location.href = searchHref;
119
+ }, 400);
120
+ }
114
121
  },
115
122
  children: renderSearchIcon(searchLink.icon)
116
123
  }) : /* @__PURE__ */ jsxRuntime.jsx(qwikCity.Link, {
117
124
  href: searchLink.href,
118
125
  class: "search-link",
119
126
  "aria-label": searchLink.ariaLabel ?? "Search Professional",
120
- onClick$: () => {
121
- isOpen.value = false;
127
+ onClick$: (e) => {
128
+ if (isOpen.value) {
129
+ e.preventDefault();
130
+ isOpen.value = false;
131
+ setTimeout(() => {
132
+ window.location.href = searchHref;
133
+ }, 400);
134
+ }
122
135
  },
123
136
  children: renderSearchIcon(searchLink.icon)
124
137
  })),
@@ -21,6 +21,7 @@ const NavigationMenu = component$(({ ariaLabel, logoComponent, listItems, action
21
21
  const renderSearchIcon = (icon) => {
22
22
  return typeof icon === "function" ? icon({}, null, 0) : icon;
23
23
  };
24
+ const searchHref = searchLink?.href ?? "";
24
25
  return /* @__PURE__ */ jsx("nav", {
25
26
  class: `menu ${isOpen.value ? "open" : ""}`,
26
27
  "aria-label": ariaLabel,
@@ -107,16 +108,28 @@ const NavigationMenu = component$(({ ariaLabel, logoComponent, listItems, action
107
108
  href: searchLink.href,
108
109
  class: "search-link",
109
110
  "aria-label": searchLink.ariaLabel ?? "Search Professional",
110
- onClick$: () => {
111
- isOpen.value = false;
111
+ onClick$: (e) => {
112
+ if (isOpen.value) {
113
+ e.preventDefault();
114
+ isOpen.value = false;
115
+ setTimeout(() => {
116
+ window.location.href = searchHref;
117
+ }, 400);
118
+ }
112
119
  },
113
120
  children: renderSearchIcon(searchLink.icon)
114
121
  }) : /* @__PURE__ */ jsx(Link, {
115
122
  href: searchLink.href,
116
123
  class: "search-link",
117
124
  "aria-label": searchLink.ariaLabel ?? "Search Professional",
118
- onClick$: () => {
119
- isOpen.value = false;
125
+ onClick$: (e) => {
126
+ if (isOpen.value) {
127
+ e.preventDefault();
128
+ isOpen.value = false;
129
+ setTimeout(() => {
130
+ window.location.href = searchHref;
131
+ }, 400);
132
+ }
120
133
  },
121
134
  children: renderSearchIcon(searchLink.icon)
122
135
  })),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@greghowe79/the-lib",
3
- "version": "2.12.3",
3
+ "version": "2.12.4",
4
4
  "description": "Collection of fast components for Qwik",
5
5
  "main": "./lib/index.qwik.mjs",
6
6
  "qwik": "./lib/index.qwik.mjs",