Fix camera jumping when opening InfoPanel
All checks were successful
Build Docker Image / build (push) Successful in 4m17s

Replace setTimeout/debounce with event-based approach:
- Add isInfoLoading computed that tracks all info loading states
- Pass infoLoading prop through CatalogPage to CatalogMap
- Watch infoLoading transition from true->false to trigger fitBounds
- Remove setTimeout hack in favor of proper loading state detection
This commit is contained in:
Ruslan Bakiev
2026-01-27 12:25:15 +07:00
parent 497a80f0c6
commit f269c0daf0
3 changed files with 28 additions and 23 deletions

View File

@@ -11,6 +11,7 @@
:show-panel="showPanel"
:filter-by-bounds="filterByBounds"
:related-points="relatedPoints"
:info-loading="isInfoLoading"
@select="onMapSelect"
@bounds-change="onBoundsChange"
@update:filter-by-bounds="$event ? setBoundsInUrl(currentMapBounds) : clearBoundsFromUrl()"
@@ -356,6 +357,11 @@ watch(searchTrigger, () => {
// Loading state
const isLoading = computed(() => offersLoading.value || selectionLoading.value)
// Info loading state for map fitBounds (true while any info data is still loading)
const isInfoLoading = computed(() =>
infoLoading.value || isLoadingProducts.value || isLoadingHubs.value || isLoadingSuppliers.value || isLoadingOffers.value
)
// Show panel when selecting OR when showing info OR when showing quote results
const showPanel = computed(() => {
return selectMode.value !== null || infoId.value !== null || showQuoteResults.value