gatsby-core-theme 29.0.1 → 29.0.2

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
@@ -1,3 +1,10 @@
1
+ ## [29.0.2](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v29.0.1...v29.0.2) (2023-09-05)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * main menu ([a20db33](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/a20db33c25997d78716b06fbb90473649682950a))
7
+
1
8
  ## [29.0.1](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v29.0.0...v29.0.1) (2023-09-04)
2
9
 
3
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gatsby-core-theme",
3
- "version": "29.0.1",
3
+ "version": "29.0.2",
4
4
  "description": "Gatsby Theme NPM Package",
5
5
  "main": "index.js",
6
6
  "directories": {
@@ -6,6 +6,7 @@ import keygen from '~helpers/keygen';
6
6
  import Item from './item';
7
7
  import styles from './items.module.scss';
8
8
  import { getPositionClass, itemHasChildren } from '~helpers/menu';
9
+ import { isMobileDevice } from '~helpers/device-detect';
9
10
 
10
11
  // Test included with menu molecule test
11
12
  const Items = ({ item, menuListRef, gtmClass = '', level = 1, canOpenAllSubMenus = true }) => {
@@ -69,7 +70,6 @@ const Items = ({ item, menuListRef, gtmClass = '', level = 1, canOpenAllSubMenus
69
70
  } else {
70
71
  link = <Item item={item} gtmClass={gtmClass} />;
71
72
  }
72
-
73
73
  return (
74
74
  <li
75
75
  ref={parentMenuRef}
@@ -81,14 +81,18 @@ const Items = ({ item, menuListRef, gtmClass = '', level = 1, canOpenAllSubMenus
81
81
  role="menuitem"
82
82
  tabIndex="0"
83
83
  onKeyDown={(e) => {
84
- if (e.defaultPrevented) return;
85
- e.preventDefault();
86
- onClick(e);
84
+ if (isMobileDevice()) {
85
+ if (e.defaultPrevented) return;
86
+ e.preventDefault();
87
+ onClick(e);
88
+ }
87
89
  }}
88
90
  onClick={(e) => {
89
- if (e.defaultPrevented) return;
90
- e.preventDefault();
91
- onClick(e);
91
+ if (isMobileDevice()) {
92
+ if (e.defaultPrevented) return;
93
+ e.preventDefault();
94
+ onClick(e);
95
+ }
92
96
  }}
93
97
  >
94
98
  {link}