@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
|
-
|
|
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 (
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
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 (
|
|
267
|
-
|
|
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
|
}, [
|