@kitconcept/volto-light-theme 7.8.4 → 7.8.6

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.draft CHANGED
@@ -1,7 +1,7 @@
1
- ## 7.8.4 (2026-04-02)
1
+ ## 7.8.6 (2026-06-15)
2
2
 
3
3
  ### Bugfix
4
4
 
5
- - Reduce sticky menu z-index to prevent overlap issues with mobile navigation. @jackahl
5
+ - refactor closing logic for fatnav to ignore all clicks on scrollbar @jackahl [#834](https://github.com/kitconcept/volto-light-theme/pull/834)
6
6
 
7
7
 
package/CHANGELOG.md CHANGED
@@ -8,6 +8,18 @@
8
8
 
9
9
  <!-- towncrier release notes start -->
10
10
 
11
+ ## 7.8.6 (2026-06-15)
12
+
13
+ ### Bugfix
14
+
15
+ - refactor closing logic for fatnav to ignore all clicks on scrollbar @jackahl [#834](https://github.com/kitconcept/volto-light-theme/pull/834)
16
+
17
+ ## 7.8.5 (2026-05-11)
18
+
19
+ ### Bugfix
20
+
21
+ - Fixed a bug that closed the Navigation when scrolling down with the scrollbar. @ TimoBroeskamp
22
+
11
23
  ## 7.8.4 (2026-04-02)
12
24
 
13
25
  ### Bugfix
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kitconcept/volto-light-theme",
3
- "version": "7.8.4",
3
+ "version": "7.8.6",
4
4
  "description": "Volto Light Theme by kitconcept",
5
5
  "main": "src/index.ts",
6
6
  "types": "src/index.ts",
@@ -1,6 +1,6 @@
1
1
  // SemanticUI-free pre-@plone/components
2
2
 
3
- import React, { useState, useEffect, useRef } from 'react';
3
+ import React, { useState, useEffect, useRef, useCallback } from 'react';
4
4
  import PropTypes from 'prop-types';
5
5
  import isEmpty from 'lodash/isEmpty';
6
6
  import { useDispatch, useSelector, shallowEqual } from 'react-redux';
@@ -50,20 +50,6 @@ const Navigation = ({ pathname }) => {
50
50
  const token = useSelector((state) => state.userSession.token, shallowEqual);
51
51
  const items = useSelector((state) => state.navigation.items, shallowEqual);
52
52
 
53
- useEffect(() => {
54
- const handleClickOutside = (e) => {
55
- if (navigation.current && doesNodeContainClick(navigation.current, e))
56
- return;
57
- closeMenu();
58
- };
59
-
60
- document.addEventListener('mousedown', handleClickOutside, false);
61
-
62
- return () => {
63
- document.removeEventListener('mousedown', handleClickOutside, false);
64
- };
65
- }, []);
66
-
67
53
  useEffect(() => {
68
54
  if (!hasApiExpander('navigation', getBaseUrl(pathname))) {
69
55
  dispatch(getNavigation(getBaseUrl(pathname), config.settings.navDepth));
@@ -84,10 +70,29 @@ const Navigation = ({ pathname }) => {
84
70
  }
85
71
  };
86
72
 
87
- const closeMenu = (index) => {
73
+ const closeMenu = useCallback(() => {
88
74
  setDesktopMenuOpen(null);
89
75
  setCurrentOpenIndex(null);
90
- };
76
+ }, []);
77
+
78
+ const handleClickOutside = useCallback(
79
+ (e) => {
80
+ if (
81
+ (navigation.current && doesNodeContainClick(navigation.current, e)) ||
82
+ e.target.parentElement === null
83
+ )
84
+ return;
85
+ closeMenu();
86
+ },
87
+ [closeMenu],
88
+ );
89
+
90
+ useEffect(() => {
91
+ document.addEventListener('mousedown', handleClickOutside, false);
92
+ return () => {
93
+ document.removeEventListener('mousedown', handleClickOutside, false);
94
+ };
95
+ }, [handleClickOutside]);
91
96
 
92
97
  useEffect(() => {
93
98
  const handleEsc = (event) => {
@@ -100,6 +105,7 @@ const Navigation = ({ pathname }) => {
100
105
  return () => {
101
106
  window.removeEventListener('keydown', handleEsc);
102
107
  };
108
+ // eslint-disable-next-line react-hooks/exhaustive-deps
103
109
  }, []);
104
110
 
105
111
  return (