Fix: virtual grid scrolling bug when container is rendered with emtpy items (switching tabs) (#4251)

This commit is contained in:
Christian Byrne
2025-06-23 00:13:46 -07:00
committed by GitHub
parent 8e2d7cabba
commit a80a939324
2 changed files with 13 additions and 7 deletions

View File

@@ -219,10 +219,6 @@ const {
const filterMissingPacks = (packs: components['schemas']['Node'][]) =>
packs.filter((pack) => !comfyManagerStore.isPackInstalled(pack.id))
whenever(selectedTab, () => {
pageNumber.value = 0
})
const isUpdateAvailableTab = computed(
() => selectedTab.value?.id === ManagerTab.UpdateAvailable
)
@@ -468,9 +464,10 @@ let gridContainer: HTMLElement | null = null
onMounted(() => {
gridContainer = document.getElementById('results-grid')
})
watch(searchQuery, () => {
watch([searchQuery, selectedTab], () => {
gridContainer ??= document.getElementById('results-grid')
if (gridContainer) {
pageNumber.value = 0
gridContainer.scrollTop = 0
}
})