From 77467b94da3c15e71cc8ebdcc477a73d66f7fe96 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Sun, 4 Aug 2019 01:38:46 -0400 Subject: [PATCH] Fix item tree crash on Cmd-left-arrow under certain conditions If a parent item was expanded and all items in the tree, including the item's child items, were selected, Cmd + Left Arrow would break the items tree until restart. This will cause a conflict and need to be applied to the new tree. (Worth noting that collapseSelectedRows() is currently only called on Cmd-left-arrow because the XUL tree seemingly swallows a regular left-arrow (and only applies the collapse to the last-selected row). The comment in the keypress listener where collapseSelectedRows() is called suggests that that was meant to be used for all left-arrow keypresses, but either that stopped working at some point or it only ever worked for Cmd + Left Arrow because it bypasses the normal tree handling of left- arrow. In any case, it would be better if left-arrow always collapsed selected rows, with or without Cmd.) https://forums.zotero.org/discussion/78515/bug-collapsing-all-items-in-a-collection-breaks-display-of-items-in-all-collections --- chrome/content/zotero/xpcom/itemTreeView.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chrome/content/zotero/xpcom/itemTreeView.js b/chrome/content/zotero/xpcom/itemTreeView.js index b0a67d0c4c..6258e34403 100644 --- a/chrome/content/zotero/xpcom/itemTreeView.js +++ b/chrome/content/zotero/xpcom/itemTreeView.js @@ -2354,7 +2354,7 @@ Zotero.ItemTreeView.prototype.collapseSelectedRows = function () { this._treebox.beginUpdateBatch(); for (var i = 0, len = this.selection.getRangeCount(); i= start.value; j--) { if (this.isContainer(j)) { this._closeContainer(j, true); }