Skip to content

Commit 8a81779

Browse files
authored
fix(google-maps): prevent blank space during page transitions (#715)
1 parent e8ddd1d commit 8a81779

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

packages/script/src/runtime/components/GoogleMaps/ScriptGoogleMaps.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -479,9 +479,11 @@ onBeforeUnmount(() => {
479479
// so anything after an `await` runs as a detached microtask.
480480
// Note: do NOT null mapsApi here — children unmount AFTER onBeforeUnmount
481481
// and need mapsApi.value for clearInstanceListeners in their cleanup.
482+
// Note: do NOT remove map DOM here — during page transitions the leave
483+
// animation is still playing, and tearing out the iframe leaves blank
484+
// space. Vue removes the parent element on actual unmount.
482485
map.value?.unbindAll()
483486
map.value = undefined
484-
mapEl.value?.firstChild?.remove()
485487
libraries.clear()
486488
queryToLatLngCache.clear()
487489
})

0 commit comments

Comments
 (0)