-
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
flexibleConnectedTo with overlayX: center Got changed 'left' in 'cdk-overlay-connected-position-bounding-box' container when scroll down to the page. #11868
Comments
I have the same problem |
I also ran into this issue and debugged my way through the demo application. I created a stackblitz to replicate the issue: https://stackblitz.com/edit/angular-material2-issue-t8rqhe What are the steps to reproduce?Basic Steps:
Extreme case:
What have I foundI debugged my way through the demo app and found these parts which I think are responsible for this bug: const smallestDistanceToViewportEdge =
Math.min(viewport.right - origin.x, origin.x - viewport.top); where Which versions of Angular, Material, OS, TypeScript, browsers are affected?Angular: ^6.0.0 As I see @crisbeto is already assigned maybe this helps and I am curious if you already have a fix for this issue? Best Regards |
… page with pushing Fixes a centered flexible overlay with pushing, on a scrolled page, not calculating the position properly. There were a couple of issues: * We were using the `top` viewport offset to calculate along the X axis, as well as `left` to calculate along Y. * We weren't accounting correctly for the scroll position. Fixes angular#11868.
… page with pushing Fixes a centered flexible overlay with pushing, on a scrolled page, not calculating the position properly. There were a couple of issues: * We were using the `top` viewport offset to calculate along the X axis, as well as `left` to calculate along Y. * We weren't accounting correctly for the scroll position. Fixes angular#11868.
… page with pushing Fixes a centered flexible overlay with pushing, on a scrolled page, not calculating the position properly. There were a couple of issues: * We were using the `top` viewport offset to calculate along the X axis, as well as `left` to calculate along Y. * We weren't accounting correctly for the scroll position. Fixes #11868.
… page with pushing (#13185) Fixes a centered flexible overlay with pushing, on a scrolled page, not calculating the position properly. There were a couple of issues: * We were using the `top` viewport offset to calculate along the X axis, as well as `left` to calculate along Y. * We weren't accounting correctly for the scroll position. Fixes #11868.
HI @vivian-hu @crisbeto |
… page with pushing (angular#13185) Fixes a centered flexible overlay with pushing, on a scrolled page, not calculating the position properly. There were a couple of issues: * We were using the `top` viewport offset to calculate along the X axis, as well as `left` to calculate along Y. * We weren't accounting correctly for the scroll position. Fixes angular#11868.
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:
Bug.
The "cdk-overlay-connected-position-bounding-box" div, style left changes with the scroll top, when ovelayX: center;
const positionStrategy = this.overlay .position() .flexibleConnectedTo(host) .withPush(true) .withDefaultOffsetX(0) .withPositions([ { originX: 'center', originY: 'bottom', overlayX: 'center', overlayY: 'top', offsetY: this.offsetY }, { originX: 'center', originY: 'top', overlayX: 'start', overlayY: 'bottom', offsetY: -1 * this.offsetY } ]);
What is the expected behavior?
"cdk-overlay-connected-position-bounding-box" div's left should be correct for horizontally center.
What is the current behavior?
"cdk-overlay-connected-position-bounding-box" div dismissed after scrolling down a certain page, since a large offset of style 'left'
What are the steps to reproduce?
Providing a StackBlitz reproduction is the best way to share your issue.
StackBlitz starter: https://goo.gl/wwnhMV
What is the use-case or motivation for changing an existing behavior?
Bug fixing
Which versions of Angular, Material, OS, TypeScript, browsers are affected?
"@angular/cdk": "^6.0.0",
"@angular/core": "^6.0.5",
"@angular/material": "^6.0.0",
"typescript": "~2.7.2",
Chrome 67
IOS 11,
userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.87 Safari/537.36'
Is there anything else we should know?
I just did upgrade the project from angular 5 to angular 6.
The text was updated successfully, but these errors were encountered: