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(cdk/overlay): fix wrong overflow calculation #17791
fix(cdk/overlay): fix wrong overflow calculation #17791
Conversation
@Goobles can you create a stackblitz that shows the issue this is fixing? The part I don't follow here is that the |
@jelbourn Here is a minimal reproduction of the bug I am experiencing: |
start.x and start.y are in the coordinate space of the overlay container, it does not contain the scrollposition of the page. |
Thanks! I see now; the change looks good to me, then. The unit tests just need to be updated. |
@Goobles are you planning to update the tests here? |
@mmalerba Oh, the test that are failing were from tests on experimental components, I don't really know how to change them correctly? |
@crisbeto are you able to help with getting the tests fixed? |
It looks like the failure is just rounding issues. You can change the test to do approximate comparison by doing something like |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
f8452e5
to
34cb475
Compare
This ones close to getting in - do you mind rebasing? |
overflowBottom is currently calculated with viewport.bottom (which could be any number from the height of the viewport to as large as your page is) calculating the overflow should just be difference between "overlay.height added to the current coordinate on the overlay container" and the height of the viewport, not the height of the entire page.
Tested component should always fit within the viewport. Pane dimensions should be approximately compared.
34cb475
to
eb830c3
Compare
@andrewseguin I rebased it |
a53a14a
to
fc0adf7
Compare
fc0adf7
to
2618c8a
Compare
* fix(cdk/overlay): fix wrong overflow calculation overflowBottom is currently calculated with viewport.bottom (which could be any number from the height of the viewport to as large as your page is) calculating the overflow should just be difference between "overlay.height added to the current coordinate on the overlay container" and the height of the viewport, not the height of the entire page. * fix(popover-edit): fix failing test Tested component should always fit within the viewport. Pane dimensions should be approximately compared. * avoid flaky errors due to narrow viewport width Co-authored-by: Gobius Dolhain <Goobles@users.noreply.github.com> Co-authored-by: Andrew Seguin <andrewjs@google.com> (cherry picked from commit d2b499d)
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. |
overflowBottom
is currently calculated withviewport.bottom
(which could be any number from the height of the viewport to as large as your page is)calculating the overflow should just be difference between
overlay.height + start.y
and the height of the viewport, not the height of the entire page.Right now the overlay is pushed out of the view in certain cases.