From 6c70ccc66cac4656c33d0415dec5f7ee5e1f6a1f Mon Sep 17 00:00:00 2001 From: Abe Jellinek Date: Wed, 12 Nov 2025 13:18:12 -0500 Subject: [PATCH] Fix Edit menu items not working in some field context menus Regression in c45ed42af. Fixes #5629, should fix #5376 (though I couldn't reproduce that) --- chrome/content/zotero/customElements.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/chrome/content/zotero/customElements.js b/chrome/content/zotero/customElements.js index 3d64b0aa50..cab62b5010 100644 --- a/chrome/content/zotero/customElements.js +++ b/chrome/content/zotero/customElements.js @@ -127,6 +127,12 @@ Services.scriptloader.loadSubScript('chrome://zotero/content/elements/itemTreeMe // This is the event we want to work with, since we do not expect events with .sourceEvent // and has no menupopup ancestor. if (originalTarget.localName === "command" && event.sourceEvent?.type === "command") { + // Don't touch commands handled internally, like cmd_undo and other Edit menu commands, + // because delaying the event would break them + if (originalTarget.getAttribute("internal") === "true") { + return; + } + event = event.sourceEvent; originalTarget = event.target; }