I\'m trying to customize mat-select with multiple checkboxes. for some reason the panel get wrong min-width as below:
and I don\'t know where its calculating t
You can style your mat-select
dialog box by giving a panel class (as you mentioned).
Please follow this demo : https://stackblitz.com/edit/angular-matselect-style?file=src/styles.css
to see the styled mat-select
components.
Reason :
cdk-overlay-pane
inside the cdk-overlay-container
container, So in case of mat-select
it provides a min-width of 180px, which is overridden by our panel class in the slight delay.mat-select
component, as i have provided 2 components and you can modify any css properties.::ng-deep
or :host >>>
, if not finding any luck,style.css
.
Update 1 :
Tried css animations
, and opacity
for making smooth opening of the mat-select
options.
.panel-class-applied-on-mat-select {
animation-name: opacityDelay !important;
animation-duration: 0.3s !important;
}
@keyframes opacityDelay {
0% {opacity: 0;}
25% {opacity: 0;}
50% {opacity: 0;}
75% {opacity: 0;}
100% {opacity: 1;}
}
Updated StackBlitz Demo