Skip to content

Flexible overlay incorrectly position perfectly fit window #14968

Closed
@jakubnavratil

Description

@jakubnavratil

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

Metadata

Metadata

Assignees

Labels

P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions