Skip to content

CdkOverlay icw FlexibleConnectedPositionStrategy breaks iOS when keyboard + scrolling #11946

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

Closed
jpzwarte opened this issue Jun 27, 2018 · 3 comments

Comments

@jpzwarte
Copy link
Contributor

Bug, feature request, or proposal:

So Overlay adds a div.cdk-overlay-container to the body with position:fixed that fills the entire viewport. Based on that behavior, when positioning the overlay component, FlexibleConnectedPositionStrategy._getOriginPoint returns the top value of the ClientRect. Since the overlay container is fixed, there is no need to take the scroll position into account.

So the component i'm displaying in the overlay contains a <input type="text"> (it's a dropdown component with autocomplete/filtering ability).

Enter iOS: When the overlay is shown, the text input gets the focus automatically. This causes iOS to show the keyboard. This also causes iOS to "disable" all fixed elements. position: fixed becomes position: absolute when the keyboard is visible.

So suddenly the behavior described in the first paragraph no longer works. It should now take the scroll position into account when calculating the originPoint.

What is the expected behavior?

It should position the overlay correctly when the iOS keyboard is visible.

What is the current behavior?

It fails to take the scroll position into account when the iOS keyboard is visible.

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

Latest angular/CDK, all iOS versions.

@jpzwarte
Copy link
Contributor Author

cc @crisbeto @josephperrott

@crisbeto
Copy link
Member

Closing as a duplicate of #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
None yet
Projects
None yet
Development

No branches or pull requests

2 participants