Skip to content

Commit 836ad79

Browse files
committed
fix(google-maps): hide info window node when opened with content (#30392)
Fixes that the info window would become visible when it is opened with explicit content. Fixes #30298. (cherry picked from commit 61103c5)
1 parent 92e7ad7 commit 836ad79

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/google-maps/map-info-window/map-info-window.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,9 @@ export class MapInfoWindow implements OnInit, OnDestroy {
231231
// undefined. If that's the case, we have to allow it to open in order to handle the
232232
// case where the window doesn't have an anchor, but is placed at a particular position.
233233
if (this.infoWindow.get('anchor') !== anchorObject || !anchorObject) {
234-
this._elementRef.nativeElement.style.display = '';
234+
// If no explicit content is provided, it is taken from the DOM node.
235+
// If it is, we need to hide it so it doesn't take up space on the page.
236+
this._elementRef.nativeElement.style.display = content ? 'none' : '';
235237
if (content) {
236238
this.infoWindow.setContent(content);
237239
}

0 commit comments

Comments
 (0)