-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
feat(select): update the trigger width when select is opened #3623
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 itsminWidth
and keeps the initialminWidth
every time its opened. (somewhat the same issue as #3573)This issue partially happens because the
cdk-connected-overlay
sets 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
_triggerWidth
property inmd-select
is never updated either.Here is a plnkr to demonstrate the issue: http://plnkr.co/edit/ERg71p?p=preview
Steps to reproduce
width
of themd-select
component by entering a diff value in thewidth
input box under it. (bothsingle
andmultiple
md-select
's will change)md-select
, and notice thewidth
of thecdk-overlay-pane
remained the same as when it was initially rendered.Proposed fix in PR
We just need to set the new
_triggerWidth
every time themd-select
is opened (open()
) taking into accountdir
/offsetX
and update theoverlayRef#OverlayState
inConnectedOverlayDirective
when thetemplate
is attached.https://github.com/angular/material2/blob/master/src/lib/core/overlay/overlay-directives.ts#L188-L202