Skip to content

fix(overlay): account for virtual keyboard offset on mobile devices #12119

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

Merged
merged 1 commit into from
Jul 12, 2018

Conversation

crisbeto
Copy link
Member

@crisbeto crisbeto commented Jul 9, 2018

This is taking over from #11947. Fixes the connected overlay positioning being thrown off, if it is opened while an input is focused (e.g. when building an autocomplete component). The issue comes from the fact that the browser will offset the entire page in order to put the input in the middle and to make space for the virtual keyboard.

Fixes #6341.

@crisbeto crisbeto added P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent target: patch This PR is targeted for the next patch release labels Jul 9, 2018
@crisbeto crisbeto requested a review from jelbourn as a code owner July 9, 2018 20:07
@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Jul 9, 2018
@crisbeto
Copy link
Member Author

crisbeto commented Jul 9, 2018

I'm marking this PR as P3 since it has been a very long-standing issue which makes the autocomplete somewhat hard to use on a touch device.

@@ -839,6 +842,17 @@ export class FlexibleConnectedPositionStrategy implements PositionStrategy {
overlayPoint = this._pushOverlayOnScreen(overlayPoint, this._overlayRect);
}

// @deletion-target 7.0.0 Remove `_overlayContainer` null check
// once it's guaranteed to be defined.
Copy link
Member

Choose a reason for hiding this comment

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

Could you expand this to explain the circumstances under which overlayContainer is not defined?

Copy link
Member Author

Choose a reason for hiding this comment

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

I've updated the comment to be a bit more thorough.

This is taking over from angular#11947. Fixes the connected overlay positioning being thrown off, if it is opened while an input is focused (e.g. when building an autocomplete component). The issue comes from the fact that the browser will offset the entire page in order to put the input in the middle and to make space for the virtual keyboard.

Fixes angular#6341.
@crisbeto crisbeto force-pushed the 6341/overlay-virtual-keyboard branch from bceba68 to 5802e6f Compare July 10, 2018 19:19
Copy link
Member

@jelbourn jelbourn left a comment

Choose a reason for hiding this comment

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

LGTM

@vmachacek
Copy link

Can someone please tell me when we can expect this to be released?

@itsanmax
Copy link

@jelbourn , @crisbeto: Thanks for fixing this issue. Please let us know how and by when we'll get this fix to test our local code?

@kwkelly
Copy link

kwkelly commented Jul 18, 2018

@vmachacek @itsanmax it looks like this was merged into 6.4.x on July 12 and is in the 6.4.0 release as of July 16 (if I'm reading the commits correctly).

https://github.com/angular/material2/commits/6.4.x

victoriaaa234 pushed a commit that referenced this pull request Jul 25, 2018
…12119)

This is taking over from #11947. Fixes the connected overlay positioning being thrown off, if it is opened while an input is focused (e.g. when building an autocomplete component). The issue comes from the fact that the browser will offset the entire page in order to put the input in the middle and to make space for the virtual keyboard.

Fixes #6341.
@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 9, 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 P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

autocompletes overlay position works wrong on mobile devices
7 participants