From 5bb2486040fa1fc617c81b4aea756ba338584f6b Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Tue, 7 Apr 2020 04:04:37 -0400 Subject: [PATCH] Fix Shift-Tab in Title and Extra fields Fixes #1806 --- chrome/content/zotero/bindings/itembox.xml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/chrome/content/zotero/bindings/itembox.xml b/chrome/content/zotero/bindings/itembox.xml index 4544938e4d..05183ec222 100644 --- a/chrome/content/zotero/bindings/itembox.xml +++ b/chrome/content/zotero/bindings/itembox.xml @@ -310,6 +310,7 @@ } this.itemTypeMenu.parentNode.hidden = false; + this.itemTypeMenu.setAttribute('ztabindex', '0'); } else { this.itemTypeMenu.parentNode.hidden = true; @@ -1768,6 +1769,10 @@ this._focusNextField(this._lastTabIndex, true); } else { + // If on the last field, allow default tab action + if (this._lastTabIndex == this._tabIndexMaxFields) { + return; + } this._focusNextField(++this._lastTabIndex); } return false; @@ -2315,7 +2320,14 @@ return false; } - next.click(); + // Drop-down needs to be focused + if (next.id == 'item-type-menu') { + next.focus(); + } + // Fields need to be clicked + else { + next.click(); + } // 1) next.parentNode is always null for some reason // 2) For some reason it's necessary to scroll to the next element when