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(connected-position-strategy): wrong logic when determining whether element is on screen #2677

Merged
merged 1 commit into from
Jan 18, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/lib/core/overlay/position/connected-position-strategy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -255,10 +255,10 @@ export class ConnectedPositionStrategy implements PositionStrategy {
let y = originPoint.y + overlayStartY + this._offsetY;

// How much the overlay would overflow at this position, on each side.
let leftOverflow = viewportRect.left - x;
let rightOverflow = (x + overlayRect.width) - viewportRect.right;
let topOverflow = viewportRect.top - y;
let bottomOverflow = (y + overlayRect.height) - viewportRect.bottom;
let leftOverflow = 0 - x;
let rightOverflow = (x + overlayRect.width) - viewportRect.width;
let topOverflow = 0 - y;
let bottomOverflow = (y + overlayRect.height) - viewportRect.height;

// Visible parts of the element on each axis.
let visibleWidth = this._subtractOverflows(overlayRect.width, leftOverflow, rightOverflow);
Expand Down