From 2020e4374e6ec9380bb81dfac44e02048765d261 Mon Sep 17 00:00:00 2001 From: Edouard Vanbelle Date: Tue, 26 May 2026 23:30:43 +0200 Subject: [PATCH] fix action bar --- static/js/features/files/batchToolbar.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/static/js/features/files/batchToolbar.js b/static/js/features/files/batchToolbar.js index b286e0bd..55bd16a3 100644 --- a/static/js/features/files/batchToolbar.js +++ b/static/js/features/files/batchToolbar.js @@ -132,6 +132,13 @@ const batchToolbar = { document.querySelectorAll('.item-checkbox').forEach((cb) => { /** @type {HTMLInputElement} */ (cb).checked = false; }); + // Reset the active component's internal selection state without going + // through onSelectionChange (which would re-enter this method). + if (this._activeComponent) { + this._activeComponent._selected.clear(); + this._activeComponent._lastClickedIndex = -1; + this._activeComponent._syncSelectAllCheckbox(); + } this._syncUI(); }, @@ -344,6 +351,8 @@ const batchToolbar = { }, _syncItemCheckboxes() { + // When a ResourceListComponent is active it owns checkbox state — skip. + if (this._activeComponent) return; document.querySelectorAll('.file-item').forEach((el) => { const cb = /** @type {HTMLInputElement} */ (el.querySelector('.item-checkbox')); if (cb) cb.checked = el.classList.contains('selected');