Description
What is the expected behavior?
Content that perfectly fit into flexible overlay should position correctly.
What is the current behavior?
IF
overlay overflows to the right of viewport caused by originElement position
AND
also should perfectly fit into viewport with margins
THEN
it is wrongly pushed to the original position and still overflows to the right of viewport
What are the steps to reproduce?
https://stackblitz.com/edit/angular-material2-issue-3s77qz?file=app%2Fapp.component.ts
Is there anything else we should know?
Should be fixed at this line: https://github.com/angular/material2/blob/e7b0e40bfa1b91b7ab05c1375f0b0d85c7e18d69/src/cdk/overlay/position/flexible-connected-position-strategy.ts#L633
Operator should be <= instead of <
I guess same could apply for height:
https://github.com/angular/material2/blob/e7b0e40bfa1b91b7ab05c1375f0b0d85c7e18d69/src/cdk/overlay/position/flexible-connected-position-strategy.ts#L639