@ndlib/component-library 1.0.12 → 1.0.13

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.
@@ -246,34 +246,30 @@ export const MenuProvider = ({ menu, children, }) => {
246
246
  }
247
247
  }, onMouseDown: () => {
248
248
  checkMidclickProps.onMouseDown();
249
- const menuItem = getMenuItem(path);
250
- if ((menuItem === null || menuItem === void 0 ? void 0 : menuItem.action.type) === MENU_ACTION_TYPE.LINK) {
251
- window.location.href = menuItem.action.to;
252
- }
253
- }, onClick: (e) => {
249
+ }, onClick: () => {
254
250
  const menuItem = getMenuItem(path);
255
251
  const isSubmenu = (menuItem === null || menuItem === void 0 ? void 0 : menuItem.action.type) === MENU_ACTION_TYPE.SUBMENU;
256
- if (!isSubmenu) {
257
- e.preventDefault();
258
- }
259
- if (isSubmenu &&
260
- isActivePath &&
261
- isTopLevel &&
262
- !isMidKeyPress.current &&
263
- isOpen) {
264
- close();
252
+ if (isSubmenu) {
253
+ if (isActivePath &&
254
+ isTopLevel &&
255
+ !isMidKeyPress.current &&
256
+ isOpen) {
257
+ close();
258
+ }
259
+ else if (isTopLevel &&
260
+ !isMidKeyPress.current &&
261
+ (!isOpen || !isActivePath)) {
262
+ setActivePath(path);
263
+ open();
264
+ }
265
+ else {
266
+ onKeyDown({
267
+ key: KEY_CODES.ENTER,
268
+ });
269
+ }
265
270
  }
266
- else if (isSubmenu &&
267
- isTopLevel &&
268
- !isMidKeyPress.current &&
269
- (!isOpen || !isActivePath)) {
270
- setActivePath(path);
271
- open();
272
- }
273
- else {
274
- onKeyDown({
275
- key: KEY_CODES.ENTER,
276
- });
271
+ else if ((menuItem === null || menuItem === void 0 ? void 0 : menuItem.action.type) === MENU_ACTION_TYPE.LINK) {
272
+ window.location.href = menuItem.action.to;
277
273
  }
278
274
  }, style: styles });
279
275
  }, [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ndlib/component-library",
3
- "version": "1.0.12",
3
+ "version": "1.0.13",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "files": [