Skip to content

Cannot adjust the min-width of MatSelect select panel #14515

@yuriydetsyk

Description

@yuriydetsyk

What is the expected behavior?

When trying to adjust min-width property of the select panel, it should be overriden properly for customization purposes: .mat-select-panel { min-width: 100% !important; }.

What is the current behavior?

After applying changed min-width property, the select panel has "jumping" width when showing/hiding.

What are the steps to reproduce?

Min-width override causes jumping: https://stackblitz.com/edit/angular-mat-select-issue
Temporary fix that I made: https://stackblitz.com/edit/angular-mat-select-issue-tempfix

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

"@angular/material": "7.0.1",
"@angular/animations": "7.0.1"
"@angular/cdk": "7.0.1"

Is there anything else we should know?

Details
I found that the most possible reason for such "jumping" effect is the "transformPanel" animation
(see @angular/material/esm2015/select.js, lines 45..65)
It uses breakpoints with different minWidth values. After commenting them out I was able to remove the "jumping" effect.

Workaround

  • My temporary workaround uses some dirty CSS hacks by hiding the overflow on the .cdk-overlay-pane, so it affects clipping of scrollbar, and that's not good at all.
  • Another possible hack might be overriding the animation, but it's also not clean at all.
  • It will be really great to see a working solution, when we talk about customizable width of select panel.

Metadata

Metadata

Assignees

Labels

area: material/selectcannot reproduceThe team is unable to reproduce this issue with the information providedneeds: clarificationThe issue does not contain enough information for the team to determine if it is a real bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions