@bobfrankston/rmfmail 1.1.201 → 1.1.203

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
@@ -3168,9 +3168,17 @@ document.addEventListener("keydown", (e) => {
3168
3168
  e.preventDefault();
3169
3169
  deleteSelection();
3170
3170
  }
3171
- // Ctrl+Z = pop the top of the undo stack (delete / move / flag).
3171
+ // Ctrl+Z = pop the top of the undo stack (delete / move / flag). Guard the
3172
+ // SAME way Delete does (the block above): never hijack Ctrl+Z when focus is
3173
+ // in a text field / contenteditable, and never while a compose overlay is
3174
+ // open — the editor (or the input) owns undo there. Without this guard the
3175
+ // mail-action undo could fire instead of an editor/text undo.
3172
3176
  if (e.ctrlKey && e.key === "z") {
3173
- if (undoStack.length > 0) {
3177
+ const t = e.target as HTMLElement | null;
3178
+ const tag = t?.tagName;
3179
+ const inEditable = tag === "INPUT" || tag === "TEXTAREA" || tag === "SELECT" || !!t?.isContentEditable;
3180
+ const composeOpen = !!document.querySelector(".compose-overlay");
3181
+ if (!inEditable && !composeOpen && undoStack.length > 0) {
3174
3182
  e.preventDefault();
3175
3183
  performUndo();
3176
3184
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bobfrankston/rmfmail",
3
- "version": "1.1.201",
3
+ "version": "1.1.203",
4
4
  "description": "Local-first email client with IMAP sync and standalone native app",
5
5
  "type": "module",
6
6
  "main": "bin/mailx.js",