From 964be0fa1c4263858e1cf65bc3e894ad3795e02b Mon Sep 17 00:00:00 2001 From: skomerko <168652295+skomerko@users.noreply.github.com> Date: Sun, 2 Mar 2025 10:15:21 +0100 Subject: [PATCH] WebUI: Maintain row highlight after rearranging table columns This PR fixes a bug where row highlight effect would be lost after reordering columns. PR #22339. --- src/webui/www/private/scripts/dynamicTable.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/webui/www/private/scripts/dynamicTable.js b/src/webui/www/private/scripts/dynamicTable.js index ee9bf554f..123b24e88 100644 --- a/src/webui/www/private/scripts/dynamicTable.js +++ b/src/webui/www/private/scripts/dynamicTable.js @@ -294,6 +294,7 @@ window.qBittorrent.DynamicTable ??= (() => { this.updateTableHeaders(); this.tableBody.replaceChildren(); this.updateTable(true); + this.reselectRows(this.selectedRowsIds()); } if (this.currentHeaderAction === "drag") { resetElementBorderStyle(el); @@ -750,10 +751,7 @@ window.qBittorrent.DynamicTable ??= (() => { reselectRows: function(rowIds) { this.deselectAll(); this.selectedRows = rowIds.slice(); - for (const tr of this.getTrs()) { - if (rowIds.includes(tr.rowId)) - tr.classList.add("selected"); - } + this.setRowClass(); }, setRowClass: function() {