@bobfrankston/rmfmail 1.1.96 → 1.1.97

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 CHANGED
@@ -2885,8 +2885,16 @@ document.addEventListener("keydown", (e) => {
2885
2885
  }
2886
2886
  // Ctrl+A = Select all visible messages
2887
2887
  if (e.ctrlKey && e.key === "a") {
2888
+ const t = e.target as HTMLElement | null;
2889
+ const tag = t?.tagName;
2890
+ // In a text field / editor, Ctrl+A means "select the text" — never
2891
+ // hijack it to select-all-messages. The old guard's `.closest(...,
2892
+ // body)` always matched (everything is inside <body>), so Ctrl+A in
2893
+ // the search box selected every message instead of the box's text,
2894
+ // and the field couldn't be selected+cleared (Bob 2026-05-18).
2895
+ if (tag === "INPUT" || tag === "TEXTAREA" || tag === "SELECT" || t?.isContentEditable) return;
2888
2896
  const mlBody = document.getElementById("ml-body");
2889
- if (mlBody && document.activeElement?.closest(".message-list, .ml-body, body")) {
2897
+ if (mlBody) {
2890
2898
  e.preventDefault();
2891
2899
  mlBody.querySelectorAll(".ml-row").forEach(r => r.classList.add("selected"));
2892
2900
  }
@@ -831,6 +831,10 @@ async function createTinyMceEditor(container2, opts = {}) {
831
831
  /* true = start */
832
832
  );
833
833
  editor2.focus();
834
+ if (pos === 0)
835
+ editor2.getWin()?.scrollTo(0, 0);
836
+ else
837
+ editor2.selection.scrollIntoView();
834
838
  } catch {
835
839
  }
836
840
  },