From 69a43ec456edf29ed1250a23550ad96a71e6f570 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Tue, 31 Aug 2021 06:54:41 -0400 Subject: [PATCH] Hack to fix sorting after reordering columns There's probably a better fix for this, but this seems to work. --- chrome/content/zotero/itemTree.jsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/chrome/content/zotero/itemTree.jsx b/chrome/content/zotero/itemTree.jsx index 03ab4567e1..4998cf597b 100644 --- a/chrome/content/zotero/itemTree.jsx +++ b/chrome/content/zotero/itemTree.jsx @@ -3265,6 +3265,9 @@ var ItemTree = class ItemTree extends LibraryTree { _handleColumnSort = async (index, sortDirection) => { let columnSettings = this._getColumnPrefs(); + // TEMP: Sort the columns by their ordinals, which can get out of sync after column + // dragging. There's probably a better way to do this. + this._getColumns().sort((a, b) => a.ordinal - b.ordinal); let column = this._getColumn(index); if (column.dataKey == 'hasAttachment') { Zotero.debug("Caching best attachment states");