Angular Material Select (mat-select) not showing when Angular Google Maps in full screen mode
Asked Answered
L

2

6

I am using Angular Material and Angular Google Maps. I have a Angular Material form in the Snazzy-Info-Window which works fine in normal mode. It displays the mat-select nicely but when I click the fullscreen button the mat-options in the mat-select don't show up. As soon as I come out of the full screen mode, I see the options panel.

Is this a bug or am I missing something. The dropdown options show up if I use the native select but not mat-select.

NORMAL MODE

enter image description here enter image description here

FULLSCREEN MODE

When in Fullscreen mode of google maps mat-select doesn't show panel but it is there when I inspect it.

enter image description here enter image description here

Lavender answered 19/12, 2018 at 18:41 Comment(1)
post your sample code!Phenomenon
K
11

The Angular material team has an overlay container which supports full screen mode.

In your root module's @NgModule definition, probably in the app.module.ts file, do this:

import {FullscreenOverlayContainer, OverlayContainer} from '@angular/cdk/overlay';

@NgModule({
    ...
    providers: [
        {provide: OverlayContainer, useClass: FullscreenOverlayContainer}
    ],
    ...
})

Now all material components which use an overlay container will work in full screen mode.

Kero answered 9/3, 2019 at 14:12 Comment(1)
That solved it for me. (I am using Angular 11 with screenfull.js)Mouldon
B
0

This issues caused by designing overlapped try this

and most important don't forget to put this at styles.scss (At root folder)

.cdk-overlay-container {
  z-index: 1050 !important;
}

OR

.cdk-overlay-container {
  z-index: 99999 !important;
}

OR

  .cdk-global-overlay-wrapper, .cdk-overlay-container {
     z-index: 99999 !important;
  }
Became answered 14/2, 2019 at 13:51 Comment(1)
I added it to the style.scss at the begining of the file but no luck. As soon as map goes to fullscreen mode dropdown disappears.Lavender

© 2022 - 2024 — McMap. All rights reserved.