Change the mat-autocomplete width?

后端 未结 5 2352
余生分开走
余生分开走 2021-02-13 17:42

It seems like the width is always the width of the input we\'re typing in. Is there no way to make it larger? I have a very small input and

5条回答
  •  栀梦
    栀梦 (楼主)
    2021-02-13 18:33

    mat-autocomplete styles are inherited from cdk-overlay-pane. In order to change width use below CSS.

    ::ng-deep .cdk-overlay-pane {
        /* Do you changes here */
          min-width:450px;
    }
    

    You can refer here for full example: https://stackblitz.com/edit/angular-vzetqy

提交回复
热议问题