@hypericon/mico 0.5.3 → 0.5.4
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.
|
@@ -74,10 +74,13 @@ class MenuManager {
|
|
|
74
74
|
// When the event is raised from within a dialog element,
|
|
75
75
|
// automatically set the menu to be a dialog as well.
|
|
76
76
|
// This makes menus that are opened from within a dialog automatically function correctly.
|
|
77
|
-
if (menu_settings_1.MENU_SETTINGS.DETECT_MENU_IN_DIALOG
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
77
|
+
if (menu_settings_1.MENU_SETTINGS.DETECT_MENU_IN_DIALOG) {
|
|
78
|
+
if ((ev === null || ev === void 0 ? void 0 : ev.target) instanceof HTMLElement && ev.target.closest("dialog")) {
|
|
79
|
+
options = options || {};
|
|
80
|
+
options.isWithinDialog = true;
|
|
81
|
+
options.asChild = true;
|
|
82
|
+
y = (_a = ev === null || ev === void 0 ? void 0 : ev.clientY) !== null && _a !== void 0 ? _a : 0; // Use clientY to position the menu within the dialog
|
|
83
|
+
}
|
|
81
84
|
}
|
|
82
85
|
const menuVnode = (0, mithril_1.default)(Menu_1.Menu, {
|
|
83
86
|
x: ev === null || ev === void 0 ? void 0 : ev.clientX,
|
|
@@ -74,10 +74,13 @@ class MenuManager {
|
|
|
74
74
|
// When the event is raised from within a dialog element,
|
|
75
75
|
// automatically set the menu to be a dialog as well.
|
|
76
76
|
// This makes menus that are opened from within a dialog automatically function correctly.
|
|
77
|
-
if (menu_settings_1.MENU_SETTINGS.DETECT_MENU_IN_DIALOG
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
77
|
+
if (menu_settings_1.MENU_SETTINGS.DETECT_MENU_IN_DIALOG) {
|
|
78
|
+
if ((ev === null || ev === void 0 ? void 0 : ev.target) instanceof HTMLElement && ev.target.closest("dialog")) {
|
|
79
|
+
options = options || {};
|
|
80
|
+
options.isWithinDialog = true;
|
|
81
|
+
options.asChild = true;
|
|
82
|
+
y = (_a = ev === null || ev === void 0 ? void 0 : ev.clientY) !== null && _a !== void 0 ? _a : 0; // Use clientY to position the menu within the dialog
|
|
83
|
+
}
|
|
81
84
|
}
|
|
82
85
|
const menuVnode = (0, mithril_1.default)(Menu_1.Menu, {
|
|
83
86
|
x: ev === null || ev === void 0 ? void 0 : ev.clientX,
|