@kitconcept/volto-light-theme 7.8.4 → 7.8.5
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 +2 -2
- package/CHANGELOG.md +6 -0
- package/package.json +2 -2
- package/src/components/Navigation/Navigation.jsx +14 -0
package/.changelog.draft
CHANGED
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kitconcept/volto-light-theme",
|
|
3
|
-
"version": "7.8.
|
|
3
|
+
"version": "7.8.5",
|
|
4
4
|
"description": "Volto Light Theme by kitconcept",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"types": "src/index.ts",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"release-it": "^19.0.3",
|
|
46
46
|
"typescript": "^5.7.3",
|
|
47
47
|
"vitest": "^3.1.2",
|
|
48
|
-
"@plone/types": "
|
|
48
|
+
"@plone/types": "2.0.0-alpha.18"
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
51
|
"@dnd-kit/core": "6.0.8",
|
|
@@ -50,10 +50,24 @@ 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
|
+
// this function doesn't close the navigation when clicking the scrollbar
|
|
54
|
+
const doesScrollbarContainClick = (e) => {
|
|
55
|
+
const clickedVerticalScrollbar =
|
|
56
|
+
e.clientX >= document.documentElement.clientWidth &&
|
|
57
|
+
e.clientX <= window.innerWidth;
|
|
58
|
+
|
|
59
|
+
const clickedHorizontalScrollbar =
|
|
60
|
+
e.clientY >= document.documentElement.clientHeight &&
|
|
61
|
+
e.clientY <= window.innerHeight;
|
|
62
|
+
|
|
63
|
+
return clickedVerticalScrollbar || clickedHorizontalScrollbar;
|
|
64
|
+
};
|
|
65
|
+
|
|
53
66
|
useEffect(() => {
|
|
54
67
|
const handleClickOutside = (e) => {
|
|
55
68
|
if (navigation.current && doesNodeContainClick(navigation.current, e))
|
|
56
69
|
return;
|
|
70
|
+
if (doesScrollbarContainClick(e)) return;
|
|
57
71
|
closeMenu();
|
|
58
72
|
};
|
|
59
73
|
|