From 37d5e99fde055e14d0cfb01544cb3c9489b01c04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adomas=20Ven=C4=8Dkauskas?= Date: Mon, 30 Aug 2021 10:22:59 +0300 Subject: [PATCH] Fix some keyboard selection bugs in HTML collection tree Moving pivot via [CMD/CTRL]+[ArrowKey] would change collection tree focus without updating the UI Select-all shortcut worked in the collection tree --- chrome/content/zotero/components/virtualized-table.jsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/chrome/content/zotero/components/virtualized-table.jsx b/chrome/content/zotero/components/virtualized-table.jsx index 4c0498aac1..800ef59cf4 100644 --- a/chrome/content/zotero/components/virtualized-table.jsx +++ b/chrome/content/zotero/components/virtualized-table.jsx @@ -221,6 +221,7 @@ class TreeSelection { set focused(index) { index = Math.max(0, index); let oldValue = this._focused; + this.pivot = index; this._focused = index; if (this.selectEventsSuppressed) return; @@ -554,7 +555,7 @@ class VirtualizedTable extends React.Component { case "a": // i.e. if CTRL/CMD pressed down - if (movePivot) this.selection.rangedSelect(0, this.props.getRowCount()-1, false, true); + if (movePivot && this.props.multiSelect) this.selection.rangedSelect(0, this.props.getRowCount()-1, false, true); break; case " ": @@ -666,7 +667,7 @@ class VirtualizedTable extends React.Component { if (this.selection.selectEventsSuppressed) return; if (movePivot) { - this.selection.focused = index; + this.selection._focused = index; this.selection.pivot = index; } // Normal selection