diff --git a/chrome/content/zotero/elements/bubbleInput.js b/chrome/content/zotero/elements/bubbleInput.js index 8173a591a3..41a1aaceb7 100644 --- a/chrome/content/zotero/elements/bubbleInput.js +++ b/chrome/content/zotero/elements/bubbleInput.js @@ -288,9 +288,9 @@ input.value += event.key; input.dispatchEvent(new Event('input', { bubbles: true })); } - // Space on bubble simulates a click - if (event.key == " ") { - event.target.click(); + // Space or arrowDown on a bubble open item details popup + if (event.key == " " || event.key == "ArrowDown") { + Utils.notifyDialog("show-details-popup", { dialogReferenceID: bubble.getAttribute("dialogReferenceID") }); event.preventDefault(); event.stopPropagation(); } @@ -302,18 +302,6 @@ if (event.key == "End") { this._body.lastChild.focus(); } - // Navigate bubble rows on arrow up/down - if (["ArrowUp", "ArrowDown"].includes(event.key)) { - let { x, y, width } = bubble.getBoundingClientRect(); - let nextBubble = Utils.getLastBubbleBeforePoint(x + (width / 2), event.key == "ArrowUp" ? y - 25 : y + 30); - // Focus the next bubble if it exists. Otherwise, event will propagate to be handled - // by keyboardHandler.js of citationDialog.js - if (nextBubble) { - nextBubble.focus(); - event.preventDefault(); - event.stopPropagation(); - } - } } // Citation dialog will record that the item is removed and the bubble will be gone after refresh() diff --git a/chrome/content/zotero/integration/citationDialog/keyboardHandler.mjs b/chrome/content/zotero/integration/citationDialog/keyboardHandler.mjs index f737438f67..5bcc339d3f 100644 --- a/chrome/content/zotero/integration/citationDialog/keyboardHandler.mjs +++ b/chrome/content/zotero/integration/citationDialog/keyboardHandler.mjs @@ -150,10 +150,8 @@ export class CitationDialogKeyboardHandler { } else if (current || event.key == "ArrowDown") { // Arrow down from input will just change the selected item without moving focus - // Arrow down from a bubble in the lowest row will move focus - let shouldFocus = event.target.classList.contains("bubble"); let multiSelect = event.shiftKey; - this._navigateGroup({ group, current, forward: event.key == "ArrowDown", shouldSelect: true, shouldFocus, multiSelect }); + this._navigateGroup({ group, current, forward: event.key == "ArrowDown", shouldSelect: true, shouldFocus: false, multiSelect }); } handled = true; }