-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
FlexibleConnectonPositionStrategy _pushOverlayOnScreen doesn't take position: fixed into account when the page is scrolled #11763
Comments
I've added a hack/workaround in my popover component to adjust "top":
|
We are experiencing something similar with v6.3.3 - seems like there is an issue in Also origin element (or any parent) is not using position:fixed in our case. Stackblitz: https://stackblitz.com/edit/angular-material2-issue-zsdwce?file=app%2Fapp.component.ts To reproduce the issue:
If I add breakpoint before EDIT: Added stackblitz example |
Experiencing the same issue as @FDIM. |
This has been fixed in the 7.0 beta by #12624. |
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:
So i have a custom component (a popover) that uses CdkOverlay to display a popover anchored to an origin element. The origin element is part of a position: fixed page-header. What happens is that the overlay initially doesn't fit in the narrowed viewport (doesn't fit on the x-axis). It then tries to push the overlay on screen using
_pushOverlayOnScreen
. While that fixes the x-axis issue, it also breaks the y-axis position.Since the page is scrolled, it calculates the
overflowTop
value using the scroll position and then incorrectly adds that value to the y position. This can cause the popover to appear halfway down the page when the page is scrolled significantly.What is the expected behavior?
It should detect that the origin (parent) element is
position: fixed
and not take the scroll position into account?Which versions of Angular, Material, OS, TypeScript, browsers are affected?
Angular 6.0.3
Cdk 6.2.0
The text was updated successfully, but these errors were encountered: