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 scrolling footer #1022

Merged
merged 1 commit into from
Dec 6, 2023
Merged

Conversation

owi92
Copy link
Member

@owi92 owi92 commented Nov 27, 2023

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. Using svh makes sure that the page is also correctly displayed on mobile devices (which is not the case with vh).

@owi92 owi92 added the changelog:user User facing changes label Nov 27, 2023
@github-actions github-actions bot temporarily deployed to test-deployment-pr1022 November 27, 2023 14:08 Destroyed
Copy link
Member

@LukasKalbertodt LukasKalbertodt left a 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...

@owi92
Copy link
Member Author

owi92 commented Dec 1, 2023

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 & > div:first-of-kind should also work and I don't mind changing it to that.

@github-actions github-actions bot temporarily deployed to test-deployment-pr1022 December 6, 2023 10:29 Destroyed
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.
@owi92 owi92 force-pushed the fix-floating-footer branch from 7737947 to cf202a0 Compare December 6, 2023 10:39
@github-actions github-actions bot temporarily deployed to test-deployment-pr1022 December 6, 2023 10:45 Destroyed
Copy link
Member

@LukasKalbertodt LukasKalbertodt left a 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"

@LukasKalbertodt LukasKalbertodt merged commit 9d183f3 into elan-ev:master Dec 6, 2023
2 checks passed
LukasKalbertodt added a commit to LukasKalbertodt/tobira that referenced this pull request Dec 14, 2023
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.
owi92 added a commit that referenced this pull request Dec 19, 2023
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.
@owi92 owi92 deleted the fix-floating-footer branch March 4, 2024 16:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog:user User facing changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants