Skip to content

Commit

Permalink
fix(google-maps): hide info window node when opened with content
Browse files Browse the repository at this point in the history
Fixes that the info window would become visible when it is opened with explicit content.

Fixes #30298.
  • Loading branch information
crisbeto committed Jan 26, 2025
1 parent e91d509 commit acdac05
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/google-maps/map-info-window/map-info-window.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,9 @@ export class MapInfoWindow implements OnInit, OnDestroy {
// undefined. If that's the case, we have to allow it to open in order to handle the
// case where the window doesn't have an anchor, but is placed at a particular position.
if (this.infoWindow.get('anchor') !== anchorObject || !anchorObject) {
this._elementRef.nativeElement.style.display = '';
// If no explicit content is provided, it is taken from the DOM node.
// If it is, we need to hide it so it doesn't take up space on the page.
this._elementRef.nativeElement.style.display = content ? 'none' : '';
if (content) {
this.infoWindow.setContent(content);
}
Expand Down

0 comments on commit acdac05

Please sign in to comment.