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)
This commit is contained in:
Abe Jellinek 2025-11-12 13:18:12 -05:00
parent 4bd829ebdb
commit 6c70ccc66c

View file

@ -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 <command> 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;
}