@bobfrankston/rmfmail 1.1.186 → 1.1.187

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.js CHANGED
@@ -3609,14 +3609,38 @@ document.addEventListener("pointerdown", (e) => {
3609
3609
  // close-then-reopen-then-close.
3610
3610
  if (target.closest("#btn-view, #btn-settings, #rail-view, #rail-settings, #rail-menu-backdrop"))
3611
3611
  return;
3612
- if (viewDropdown && !viewDropdown.hidden && !target.closest("#view-menu") && !target.closest("#view-dropdown")) {
3613
- viewDropdown.hidden = true;
3614
- }
3615
- if (settingsDropdown && !settingsDropdown.hidden && !target.closest("#settings-menu") && !target.closest("#settings-dropdown")) {
3616
- settingsDropdown.hidden = true;
3617
- }
3612
+ // Re-query the dropdown elements FRESH on every pointerdown rather than
3613
+ // using the module-load-time references. If anything re-rendered the
3614
+ // toolbar (theme change, update banner, settings-applied repaint) the
3615
+ // cached node is detached and `.hidden = true` on it does nothing while
3616
+ // the live element stays visible — the "menu won't close until I restart
3617
+ // the app" bug (Bob 2026-05-28). Querying live makes it robust against
3618
+ // element replacement.
3619
+ const viewDd = document.getElementById("view-dropdown");
3620
+ const settingsDd2 = document.getElementById("settings-dropdown");
3621
+ if (viewDd && !viewDd.hidden && !target.closest("#view-menu") && !target.closest("#view-dropdown")) {
3622
+ hideDropdownHard(viewDd);
3623
+ }
3624
+ if (settingsDd2 && !settingsDd2.hidden && !target.closest("#settings-menu") && !target.closest("#settings-dropdown")) {
3625
+ hideDropdownHard(settingsDd2);
3626
+ }
3627
+ document.getElementById("rail-menu-backdrop")?.remove();
3618
3628
  refreshToolbarOverlayShield();
3619
3629
  }, true);
3630
+ /** Hide a toolbar/rail dropdown so it STAYS hidden regardless of how it was
3631
+ * opened. `.hidden = true` alone isn't enough when the rail path left inline
3632
+ * `position:fixed; display/visibility` styles on the element — an inline
3633
+ * `display` would override the `[hidden]` UA rule and the menu would stay
3634
+ * visible until an app restart cleared the element (Bob 2026-05-28 "click
3635
+ * outside the settings menu but it does not go away"). Clear the inline
3636
+ * style block too so nothing can keep it on screen. */
3637
+ function hideDropdownHard(dd) {
3638
+ dd.hidden = true;
3639
+ // Wipe rail-modal inline styles (position/top/left/transform/zIndex/…).
3640
+ // Safe for the toolbar path too — its position comes from CSS classes,
3641
+ // not inline styles, so clearing inline leaves it correct.
3642
+ dd.style.cssText = "";
3643
+ }
3620
3644
  // Click-to-dismiss for the toolbar dropdowns relies on `pointerdown` firing
3621
3645
  // on the parent document. Clicks inside the compose iframe stay in the
3622
3646
  // iframe's document and never bubble out, so a Settings/View menu opened