ct-material-dashboard-pro-angular icon indicating copy to clipboard operation
ct-material-dashboard-pro-angular copied to clipboard

options in mat-select appear behind modal

Open sebas0205 opened this issue 5 years ago • 13 comments

I have a form in a modal view . In form i have a , but when I try to show de list , it appears behind the modal view.

sebas0205 avatar Jan 20 '20 22:01 sebas0205

same issue , also tried with .mat-select-panel z-index: 9999 !important or .cdk-global-overlay-wrapper, .cdk-overlay-container z-index: 99999 !important

and nothing

rodrigochapeta avatar Jan 21 '20 19:01 rodrigochapeta

Same issue!!!

cloudevcom avatar Feb 14 '20 01:02 cloudevcom

please fix this issue!!

bugger16 avatar Mar 21 '20 08:03 bugger16

go to : "~@angular/material/prebuilt-themes/indigo-pink.css" search
.cdk-overlay-connected-position-bounding-box and change z-index from 1000 to 9999

toukaba avatar Mar 29 '20 00:03 toukaba

So there are 2 solutions that worked for me:

  1. solution: Add the below style in your global CSS file(styles.css or .scss file) .cdk-global-overlay-wrapper, .cdk-overlay-container { z-index: 10000 !important; }
  2. solution: Add in .ts file of your component @Component({ selector: 'app-add-edit', templateUrl: './add-edit.component.html', styleUrls: ['./add-edit.component.scss'], encapsulation: ViewEncapsulation.None }) and then same lines from solution 1 to the component.css or .scss. This means when you navigate to this component, it will add that .css globally. (Technically the same effect, except that first solution will work on all components, second one only on that component)

@toukaba - that will work only locally on your pc. If you push code and someone clone it and run npm install to download neccesssary node modules, that will not work anymore. So in real apps if you are working in a real company you can't do that.

Dacili avatar May 08 '20 11:05 Dacili

@Dacili unfortunately the solution you gave didn't work either For me

::ng-deep .cdk-overlay-connected-position-bounding-box { z-index: 10000 !important; }

this code worked. but if you have multiple select with multiple options, mat-select not closing.I will share the screenshot of the result

Screenshot 2020-11-15 at 8 10 03 AM

Mathewkutty avatar Nov 15 '20 02:11 Mathewkutty

Same problem. 😕

mat-select behind the "ng-template #content let-modal"

image

washington93 avatar Nov 23 '20 18:11 washington93

Hi @washington93,

Thank you for working with our products.

Can you please give me the code or a link to your website so I can test and fix it?

Thank you, Rares

rarestoma avatar Nov 25 '20 07:11 rarestoma

@washington93 i found the work around.

::ng-deep .cdk-overlay-connected-position-bounding-box { z-index: 10000 !important; }

::ng-deep .cdk-global-overlay-wrapper { z-index: 1000 !important; }

add this in you css file

Mathewkutty avatar Nov 25 '20 13:11 Mathewkutty

@Mathewkutty thanks.

I added an import to the file material-dashboard.scss. 👇🏾 image

with its instructions slightly altered...

image

mauriciolsfilho avatar Jul 10 '21 03:07 mauriciolsfilho

::ng-deep

::ng-deep is deprecated

mohitmunjal2801 avatar Aug 04 '21 12:08 mohitmunjal2801

In your material-dashboard.scss file add this code below And that works for me

.cdk-overlay-connected-position-bounding-box, .cdk-global-overlay-wrapper, .cdk-overlay-container{ z-index: 99999 !important; }

AiltonDcc avatar Nov 18 '21 09:11 AiltonDcc

So there are 2 solutions that worked for me:

  1. solution: Add the below style in your global CSS file(styles.css or .scss file) .cdk-global-overlay-wrapper, .cdk-overlay-container { z-index: 10000 !important; }
  2. solution: Add in .ts file of your component @component({ selector: 'app-add-edit', templateUrl: './add-edit.component.html', styleUrls: ['./add-edit.component.scss'], encapsulation: ViewEncapsulation.None }) and then same lines from solution 1 to the component.css or .scss. This means when you navigate to this component, it will add that .css globally. (Technically the same effect, except that first solution will work on all components, second one only on that component)

@toukaba - that will work only locally on your pc. If you push code and someone clone it and run npm install to download neccesssary node modules, that will not work anymore. So in real apps if you are working in a real company you can't do that.

thanks Bud Its working for me

sandeep190 avatar May 24 '22 08:05 sandeep190