-
Notifications
You must be signed in to change notification settings - Fork 6.8k
feat(select): update the trigger width when select is opened #3623
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
when changing the width of the `host` (or using flex box) the `div.cdk-overlay-pane` keeps the initial width
|
@emoralesb05 Is this still an issue with the current version? If so, would you mind rebasing? Sorry for the late review. |
|
@kara yes its still an issue, i updated the plnkr with the latest version to try it. Rebasing it so we can hopefully merge it soon 😄 |
|
OK, ping me when it's ready for review again :) |
|
Im actually gonna create another PR since rebasing 5-6 months worth of code is taking its toll on me haha 😂 .. |
|
Haha, fair enough. Ping me when your new PR is ready, and I'll review ASAP to avoid more conflicts. |
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
When changing the width of the
md-select(e.g. using flex box) after its rendered, thetemplate[cdk-connected-overlay]does not update itsminWidthand keeps the initialminWidthevery time its opened. (somewhat the same issue as #3573)This issue partially happens because the
cdk-connected-overlaysets thewidth,minWidth, etc etc only once and never updates it again.https://github.com/angular/material2/blob/master/src/lib/core/overlay/overlay-directives.ts#L181
But also because the
_triggerWidthproperty inmd-selectis never updated either.Here is a plnkr to demonstrate the issue: http://plnkr.co/edit/ERg71p?p=preview
Steps to reproduce
widthof themd-selectcomponent by entering a diff value in thewidthinput box under it. (bothsingleandmultiplemd-select's will change)md-select, and notice thewidthof thecdk-overlay-paneremained the same as when it was initially rendered.Proposed fix in PR
We just need to set the new
_triggerWidthevery time themd-selectis opened (open()) taking into accountdir/offsetXand update theoverlayRef#OverlayStateinConnectedOverlayDirectivewhen thetemplateis attached.https://github.com/angular/material2/blob/master/src/lib/core/overlay/overlay-directives.ts#L188-L202