Skip to content
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

Merged
merged 3 commits into from Aug 7, 2017

Conversation

willshowell
Copy link
Contributor

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 .

@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Aug 4, 2017
@@ -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;
Copy link
Contributor

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.

Copy link
Contributor Author

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

Copy link
Contributor

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...

@mmalerba
Copy link
Contributor

mmalerba commented Aug 5, 2017

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.

Copy link
Member

@crisbeto crisbeto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good, but I think that we still need those above/below classes to do the offset. If you look at these screenshots, the panel is a bit off with regards to the input container.

1

2

@willshowell
Copy link
Contributor Author

@crisbeto weird... it looks like the 6px/24px offsets are still there. Is that Edge? Chrome 59 macOS shows this:

screen shot 2017-08-07 at 9 55 34 am

screen shot 2017-08-07 at 9 55 43 am

@crisbeto
Copy link
Member

crisbeto commented Aug 7, 2017

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.

@willshowell
Copy link
Contributor Author

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.

Copy link
Member

@crisbeto crisbeto left a 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

@crisbeto crisbeto added pr: lgtm action: merge The PR is ready for merge by the caretaker labels Aug 7, 2017
@willshowell
Copy link
Contributor Author

Could you remove the merge-ready label? I'd like to remove a couple more unused lines supporting the old approach, per @mmalerba's suggestion.

@crisbeto crisbeto removed the action: merge The PR is ready for merge by the caretaker label Aug 7, 2017
@willshowell
Copy link
Contributor Author

Thanks @crisbeto, change made

@crisbeto crisbeto added the action: merge The PR is ready for merge by the caretaker label Aug 7, 2017
@mmalerba mmalerba merged commit 667a4e4 into angular:master Aug 7, 2017
@willshowell willshowell deleted the fix/autocomplete-attachment branch September 21, 2017 14:22
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker cla: yes PR author has agreed to Google's Contributor License Agreement
Projects
None yet
4 participants