@qhealth-design-system/core 1.18.3 → 1.18.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.
package/CHANGELOG.md CHANGED
@@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## Unreleased
9
9
 
10
+ ## 1.18.4 - 2025-11-24
11
+
10
12
  ## 1.18.3 - 2025-11-20
11
13
 
12
14
  ## 1.18.2 - 2025-11-19
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qhealth-design-system/core",
3
- "version": "1.18.3",
3
+ "version": "1.18.4",
4
4
  "description": "",
5
5
  "licence": "MIT",
6
6
  "main": "index.js",
@@ -22,6 +22,8 @@ let isHeaderOpen = false;
22
22
  let headerSearchEvents = {};
23
23
  // Breakpoint for mobile mode
24
24
  const mobileBreakpoint = 992;
25
+ // Hold width value to detect resize
26
+ let lastWidth = window.innerWidth;
25
27
 
26
28
  export default function initHeader(document = document) {
27
29
  // Add action so the search works only if JS is enabled
@@ -40,6 +42,11 @@ export default function initHeader(document = document) {
40
42
 
41
43
  // We want to ensure the search input is visible on desktop at all times
42
44
  window.addEventListener("resize", () => {
45
+ const currentWidth = window.innerWidth;
46
+ // Ignore resize events that do not change the viewport size. Required for Android devices
47
+ if (currentWidth === lastWidth) return;
48
+ else lastWidth = currentWidth;
49
+
43
50
  if (window.innerWidth >= mobileBreakpoint && !isHeaderOpen) {
44
51
  openHeader(false);
45
52
  // Disable focus trap as it's not needed on desktop
@@ -225,5 +232,5 @@ function addEvent(element, event, rawHandler) {
225
232
  * @param {event} token The event to remove
226
233
  */
227
234
  function removeEvent(token) {
228
- token.element.removeEventListener(token.event, token.handler);
235
+ if (token && token.element) token.element.removeEventListener(token.event, token.handler);
229
236
  }