diff --git a/chrome/content/zotero/itemPane.js b/chrome/content/zotero/itemPane.js index 26e27a8c16..205c0d5a21 100644 --- a/chrome/content/zotero/itemPane.js +++ b/chrome/content/zotero/itemPane.js @@ -1028,15 +1028,26 @@ var ZoteroItemPane = new function() if (row == row.parentNode.lastChild) { _tabDirection = 1; + var lastTag = true; } } target.blur(); + + // Return focus to items pane + if (!lastTag) { + document.getElementById('zotero-items-tree').focus(); + } + return false; case event.DOM_VK_ESCAPE: // Reset field to original value target.value = target.getAttribute('value'); target.blur(); + + // Return focus to items pane + document.getElementById('zotero-items-tree').focus(); + return false; case event.DOM_VK_TAB: @@ -1199,11 +1210,6 @@ var ZoteroItemPane = new function() } _focusNextField(focusMode, focusBox, _lastTabIndex, _tabDirection==-1); } - // If not tab and not new tag, return focus to items pane - // DEBUG: is this the best place for this? - else if (focusMode != 'tags') { - document.getElementById('zotero-items-tree').focus(); - } } function modifyField(field, value)