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");