@bobfrankston/rmfmail 1.0.649 → 1.0.650
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/client/app.ts +15 -11
- package/package.json +1 -1
package/client/app.ts
CHANGED
|
@@ -2685,22 +2685,26 @@ viewBtn?.addEventListener("click", (e) => {
|
|
|
2685
2685
|
restoreToolbarDropdown("view-dropdown", "view-menu");
|
|
2686
2686
|
if (viewDropdown) viewDropdown.hidden = !viewDropdown.hidden;
|
|
2687
2687
|
});
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
|
|
2694
|
-
|
|
2695
|
-
// check ensures inside-clicks pass through and outside-clicks close.
|
|
2688
|
+
// Capture-phase pointerdown so we run BEFORE any handler that calls
|
|
2689
|
+
// stopPropagation. The earlier bubble-phase click listener missed clicks
|
|
2690
|
+
// when an upstream handler swallowed propagation, and the menu stayed open.
|
|
2691
|
+
// pointerdown also feels snappier than waiting for click (which fires on
|
|
2692
|
+
// pointerup). The closest() checks let inside-clicks (radio buttons,
|
|
2693
|
+
// checkboxes, the input) keep the menu open.
|
|
2694
|
+
document.addEventListener("pointerdown", (e) => {
|
|
2696
2695
|
const target = e.target as HTMLElement | null;
|
|
2697
|
-
if (
|
|
2696
|
+
if (!target) return;
|
|
2697
|
+
// Don't close if the click is on the toolbar button that toggles us —
|
|
2698
|
+
// its own handler will run after this and toggle, otherwise we'd
|
|
2699
|
+
// close-then-reopen-then-close.
|
|
2700
|
+
if (target.closest("#btn-view, #btn-settings, #rail-view, #rail-settings, #rail-menu-backdrop")) return;
|
|
2701
|
+
if (viewDropdown && !viewDropdown.hidden && !target.closest("#view-menu") && !target.closest("#view-dropdown")) {
|
|
2698
2702
|
viewDropdown.hidden = true;
|
|
2699
2703
|
}
|
|
2700
|
-
if (settingsDropdown && !settingsDropdown.hidden && !target
|
|
2704
|
+
if (settingsDropdown && !settingsDropdown.hidden && !target.closest("#settings-menu") && !target.closest("#settings-dropdown")) {
|
|
2701
2705
|
settingsDropdown.hidden = true;
|
|
2702
2706
|
}
|
|
2703
|
-
});
|
|
2707
|
+
}, true);
|
|
2704
2708
|
// Escape always closes any open dropdown/backdrop, regardless of how it was
|
|
2705
2709
|
// opened or whether an outside-click handler missed firing. Last-resort
|
|
2706
2710
|
// escape hatch for the "stuck modal" case.
|