-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
Autocomplete panel should base width on input-container, not input #4914
Comments
I think this needs to be thought through a bit better. Apart from taking the width from the container, the autocomplete would also have to position itself relative to it, otherwise it'll be off if there's a prefix. This complicates things, because the container has some padding at the bottom, which will cause the panel to float ~10px below where it should be. |
@crisbeto what if it were instead attached to the container's |
That should work, I wasn't aware that we were even exporting that reference. I'll update my PR. |
Thinking about it again, the underline isn't ideal either: if we use it as a reference, the panel will end up overlapping the input when it goes into the |
Oh true. You could do what autocomplete is doing with its negative margin when |
Not really, we shouldn't know or have to measure the height of the input. |
Do you suppose the position strategy could be more flexible to support something like
.connectedTo(
this._inputContainer.underlineRef,
{originX: 'start', originY: 'bottom'}, {overlayX: 'start', overlayY: 'top'})
.withFallbackPosition(
this._inputContainer,
{originX: 'start', originY: 'top'}, {overlayX: 'start', overlayY: 'bottom'}); |
I can see how adding that to the API could be useful, but I'm not sure that it would help here either. Positioning it to the top of the container would still add a lot of space to the panel offset due to the space that is reserved for the floating label. |
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. |
Bug, feature request, or proposal:
Bug
Expected
The autocomplete panel does not change its width when the input resizes, only when the input container does.
Current
The autocomplete panel resizes when an
mdSuffix
is rendered, thus changing the size of the actualinput
.Reproduction
https://plnkr.co/edit/VrcrcUBKbwuoOoxc8byM?p=preview
Motivation
Using a "clear input" button on an autocomplete input
Proposed change
The text was updated successfully, but these errors were encountered: