open itembox creator type menu on arrowUp/down (#4257)

To preserve behavior from zotero 6. We likely want to make
the creator type menu a proper menulist in the future.

Addresses: #4248
This commit is contained in:
abaevbog 2024-06-19 02:28:26 -04:00 committed by GitHub
parent 24b5f2efb4
commit 13812f46b4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1702,11 +1702,17 @@
// Otherwise let the autocomplete popup handle matters // Otherwise let the autocomplete popup handle matters
} }
// Handle Shift-Enter on creator input field
handleCreatorRowKeyDown(event) { handleCreatorRowKeyDown(event) {
// Open creator type menu on arrowUp/Down as if it is a menulist
if (event.target.classList.contains("creator-type-label")
&& ["ArrowDown", "ArrowUp"].includes(event.key)) {
event.target.click();
return;
}
let target = event.target.closest("editable-text"); let target = event.target.closest("editable-text");
if (!target) return; if (!target) return;
// Handle Shift-Enter on creator input field
if (event.key == "Enter" && event.shiftKey) { if (event.key == "Enter" && event.shiftKey) {
event.stopPropagation(); event.stopPropagation();
// Value has changed - focus empty creator row at the bottom // Value has changed - focus empty creator row at the bottom