-
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
fix(autocomplete): attach overlay to a more accurate input element #6282
fix(autocomplete): attach overlay to a more accurate input element #6282
Conversation
@@ -457,6 +457,7 @@ export class MdInputContainer implements AfterViewInit, AfterContentInit, AfterC | |||
|
|||
/** Reference to the input's underline element. */ | |||
@ViewChild('underline') underlineRef: ElementRef; | |||
@ViewChild('connectionContainer') _connectionContainerRef: ElementRef; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you not use the underlineRef
? The datepicker is using it for a similar purpose.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#4914 (comment) You still have to add an offset for when the fallback is above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, the fallback can't just cover the input in this case like with the datepicker, since the user still needs to be able to see what they're typing. Makes sense...
Also for the no-longer-used bits of the API, lets get rid of them and if we encounter too many problems trying to merge it into Google's codebase we can add them back. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@crisbeto weird... it looks like the 6px/24px offsets are still there. Is that Edge? Chrome 59 macOS shows this: |
I looked at it in Chrome 59 or 60 on Windows. I can take another look later today, maybe I didn't check out the changes correctly. |
Just checked on Windows and it looked the same to me. Also deployed to https://willshowell-demo.firebaseapp.com/autocomplete Also note that half of the 2px focused underline is obstructed when panel is below because the underline and ripple are absolutely positioned. I can add back a 1px offset or leave as is and later look into possible underline changes that would fix it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright, it was my bad when I was testing it out last time. LGTM
Could you remove the |
Thanks @crisbeto, change made |
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. |
Fixes #4914
Fixes #5709
I removed the
.mat-autocomplete-panel-below
and.mat-autocomplete-panel-above
classes since they were only being used for css offsets, but maybe they should stay if users have been querying them?Additionally, it looks like
positionY: AutocompletePositionY
and_subscribeToPositionChanges
are no longer needed internally, but thought I should check first before removing parts of the public API .