-
Notifications
You must be signed in to change notification settings - Fork 18
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 scrolling footer #1022
Fix scrolling footer #1022
Conversation
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.
Mhhh while svh
seems to be supported by most browsers, this is rather recent and does not work in Opera. Would the issue also be fixed by simply replacing & > div
with & > div:first-of-kind
? Or somehow else annotating height: 100%
to only our own div?
I wouldn't hard block svh but... if we can easily avoid bumping the browser requirement for such layout-critical thing...
Looking at caniuse, it seems to me that these new units are supported by almost every browser, including opera. Or did you test this with opera mini? (source: https://caniuse.com/mdn-css_types_length_viewport_percentage_units_small). But I think |
The footer was scrolling with certain browser extensions that add hidden divs to the body. We were setting all descendant divs of the body to `100%` height, which caused them to either push elements up or let users scroll beyond any visible content. The solution is to only set the height on the first descendant div.
7737947
to
cf202a0
Compare
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.
Indeed seems to be fixed with "Loom – Screen Recorder & Screen Capture"
Follow up to elan-ev#1022 where stupidly suggested `:first-of-kind` because suuurely, browser extensions would only add elements to the end of the `<body>` but not the beginning, riiight? Of course that's a wrong assumption. I noticed this with Bitwarden on the login page. This whole "extensions randomly modifying DOM" thing seems super brittle to me, oof.
Follow up to #1022 where stupidly suggested `:first-of-kind` because suuurely, browser extensions would only add elements to the end of the `<body>` but not the beginning, riiight? Of course that's a wrong assumption. I noticed this with Bitwarden on the login page. This whole "extensions randomly modifying DOM" thing seems super brittle to me, oof.
The footer was scrolling with certain browser extensions that add hidden divs to the body.
We were setting all descendant divs of the body to
100%
height, which caused them to either push elements up or let users scroll beyond any visible content.This is fixed by removing the child combinator and adding a height rule using the newish svh (= small viewport height) to the
<Outer>
wrapper component only. Usingsvh
makes sure that the page is also correctly displayed on mobile devices (which is not the case withvh
).