mirror of
https://github.com/zotero/zotero.git
synced 2026-09-28 01:31:40 +00:00
Click on itemBox label focus edits (#5065)
Click on a label of a focused field will refocus itemTree or the reader content, depending on the tab. That way focus is not lost. Fixes: #5063
This commit is contained in:
parent
c262a5b392
commit
d3cee95fb7
2 changed files with 10 additions and 2 deletions
|
|
@ -700,7 +700,7 @@
|
|||
|
||||
let labelWrapper = event.target.closest(".meta-label");
|
||||
if (labelWrapper.nextSibling.contains(document.activeElement)) {
|
||||
document.activeElement.blur();
|
||||
ZoteroPane.itemsView.focus();
|
||||
}
|
||||
else if (!labelWrapper.nextSibling.firstChild.readOnly) {
|
||||
labelWrapper.nextSibling.firstChild.focus();
|
||||
|
|
|
|||
|
|
@ -1679,7 +1679,15 @@
|
|||
|
||||
let labelWrapper = label.closest(".meta-label");
|
||||
if (labelWrapper.nextSibling.contains(document.activeElement)) {
|
||||
document.activeElement.blur();
|
||||
// click on label when value field is already focused
|
||||
// will refocus itemTree in library tab or reader content in reader tab
|
||||
if (Zotero_Tabs.selectedType === "library") {
|
||||
ZoteroPane.itemsView.focus();
|
||||
}
|
||||
else {
|
||||
let reader = Zotero.Reader.getByTabID(Zotero_Tabs.selectedID);
|
||||
reader.focus();
|
||||
}
|
||||
}
|
||||
else {
|
||||
let valueField = labelWrapper.nextSibling.firstChild;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue