mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-06-19 08:52:05 -03:00
fix(virtual-scroll): avoid full reload on move-to-folder, scroll to top on filter/page reset
- MoveManager/SidebarManager: replace resetAndReload with in-place VirtualScroller update after move operations (remove non-visible, update visible items' file_path). Preserves scroll position and avoids empty grid. - VirtualScroller: add removeMultipleItemsByFilePath for efficient batch removal with Array.isArray guard. - baseModelApi: scroll to top on loadMoreWithVirtualScroll(true), covering filter/sort/search/folder/views changes. - SidebarManager selectFolder: scroll now handled centrally.
This commit is contained in:
@@ -133,6 +133,16 @@ export class BaseModelApiClient {
|
||||
pageState.hasMore = result.hasMore;
|
||||
pageState.currentPage = pageState.currentPage + 1;
|
||||
|
||||
// When resetting to page 1, scroll back to the top
|
||||
// This covers: folder selection, filter/sort/search changes,
|
||||
// favorites/update/excluded view toggles, alphabet filter, etc.
|
||||
if (resetPage) {
|
||||
const scrollContainer = document.querySelector('.page-content');
|
||||
if (scrollContainer) {
|
||||
scrollContainer.scrollTop = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (updateFolders) {
|
||||
sidebarManager.refresh();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user