Its been couple of days since i have not found the solution for this. As there is an option for mat-menu that is overlaptrigger property but there is no property to perform this in mat select dropdown. Is there any way to customize the mat-select dropdown position by overriding the css or any better solution.
相关问题
- Angular RxJS mergeMap types
- npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fs
- How to update placeholder text in ng2-smart-table?
- How to instantiate Http service in main.ts manuall
- Angular: ngc or tsc?
相关文章
- angular脚手架在ie9+下兼容问题
- angular 前端项目 build 报错 "Cannot find module 'le
- Angular Material Stepper causes mat-formfield to v
- After upgrade to Angular 9 cannot find variable in
- is there any difference between import { Observabl
- Suppress “Circular dependency detected” suppress w
- How can you get current positional information abo
- Angular material table not showing data
I've found the solution as disableOptionCentering direcrive for mat-select, so after using this dropdaown can be customized.
from timmoy: https://github.com/angular/material2/pull/9885
Example usage:
Utilize disableOptionCentering and panelClass like I have above. Then within your styles.scss reference your panelClass and do
This worked for me. Note that the scss must be in your styles.scss not your component's scss file. You might not need to use important here, I have other classes around this so I did use it.
I am also using this
disableOptionCentering
with mat-select andpanelClass
but I am facing issue when dropdown position is at the bottom of the page and I do have multiple options in my dropdown. When I scroll in the dropdown and select the last option then overlay goes up and calculate wrong offset based upon the margin-top given in the panelClass definition.Please find the logged issue reference here https://github.com/angular/components/issues/18045