fix(bulk): restore card selection when virtual scroller recreates cards

This commit is contained in:
Will Miao
2026-08-26 09:28:17 +08:00
parent 08895f77ff
commit 0b08ad283a
4 changed files with 172 additions and 3 deletions
+6
View File
@@ -544,6 +544,12 @@ export class MasonryScroller {
modelCard.style.minWidth = '0';
}
// Scroll recycling rebuilds cards from scratch, dropping `.selected`
// even though the filepath is still selected in state.
if (state.bulkMode && modelCard && state.selectedModels.has(modelCard.dataset.filepath)) {
modelCard.classList.add('selected');
}
return element;
}
+6
View File
@@ -497,6 +497,12 @@ export class VirtualScroller {
modelCard.style.minWidth = '0';
}
// Scroll recycling rebuilds cards from scratch, dropping `.selected`
// even though the filepath is still selected in state.
if (state.bulkMode && modelCard && state.selectedModels.has(modelCard.dataset.filepath)) {
modelCard.classList.add('selected');
}
return element;
}