Mat-select panel min-width

前端 未结 4 1330
灰色年华
灰色年华 2021-02-10 15:00

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

4条回答
  •  南方客
    南方客 (楼主)
    2021-02-10 15:36

    You'll need to change viewEncapsulation to none at your component decorator.and then add following css to remove the transition effect.Have a look at viewencapsulation in angular docs https://angular.io/guide/component-styles#view-encapsulation.

    @Component({
    selector: 'app-selector',
    templateUrl: './template.html',
    styleUrls: ['./template.css'],
    encapsulation: ViewEncapsulation.None
    })
    //CSS
    .cdk-overlay-connected-position-bounding-box .cdk-overlay-pane .mat-select-panel.ng-animating {
    display: none;
    }
    

提交回复
热议问题