Skip to content

Commit

Permalink
fix(material/select): provide horizontal fallback positions (#27267)
Browse files Browse the repository at this point in the history
The select had configured its positions under the assumption that the dropdown is always as wide as the trigger so it only provided a vertical fallback position. Since users are now able to control the panel width, we also need horizontal fallbacks.

Fixes #27256.
  • Loading branch information
crisbeto committed Jun 9, 2023
1 parent e8fb751 commit fd9591b
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/material/select/select.ts
Expand Up @@ -1303,13 +1303,26 @@ export class MatSelect extends _MatSelectBase<MatSelectChange> implements OnInit
overlayX: 'start',
overlayY: 'top',
},
{
originX: 'end',
originY: 'bottom',
overlayX: 'end',
overlayY: 'top',
},
{
originX: 'start',
originY: 'top',
overlayX: 'start',
overlayY: 'bottom',
panelClass: 'mat-mdc-select-panel-above',
},
{
originX: 'end',
originY: 'top',
overlayX: 'end',
overlayY: 'bottom',
panelClass: 'mat-mdc-select-panel-above',
},
];

/** Ideal origin for the overlay panel. */
Expand Down

0 comments on commit fd9591b

Please sign in to comment.