Skip to content

Prevent "Back to Top" button from being cropped on firefox/android - #2442

Open
Yann-P wants to merge 3 commits into
pydata:mainfrom
Yann-P:fix-simplify-backtotop
Open

Prevent "Back to Top" button from being cropped on firefox/android#2442
Yann-P wants to merge 3 commits into
pydata:mainfrom
Yann-P:fix-simplify-backtotop

Conversation

@Yann-P

@Yann-P Yann-P commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

Fixes #2411

Cropping fixed by using a bottom anchor instead of top

@Yann-P

Yann-P commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator Author

This fixes the button being cropped

But the flicker is still happening on firefox/android. Not happening in chrome/android or safari/ios

I assume there is something funny about the scroll event listener in firefox/android

@Yann-P Yann-P changed the title Prevent "Back to Top" button from flickering/being cropped on mobile. Prevent "Back to Top" button from flickering/being cropped on firefox/android Jul 10, 2026
@Yann-P
Yann-P force-pushed the fix-simplify-backtotop branch from caf98b0 to a597f58 Compare July 29, 2026 09:46
@Yann-P Yann-P changed the title Prevent "Back to Top" button from flickering/being cropped on firefox/android Prevent "Back to Top" button from being cropped on firefox/android Jul 29, 2026
@Yann-P

Yann-P commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator Author

Flickering is a firefox bug when the address bar changes sides. I don't think we should add complexity in the code for this, so narrowing down the fix to only the cropping problem.

@Yann-P Yann-P self-assigned this Jul 29, 2026

@sanmaxdev sanmaxdev left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Built the theme locally to confirm the SCSS compiles and the back-to-top rule now emits bottom: 2dvh in the compiled CSS. stylelint and prettier are clean on the changed file. dvh is already used in _sidebar-toggle.scss, so this is consistent with the rest of the codebase.

One heads-up: the PR body says Fixes #2411, which auto-closes the issue on merge. The issue covers both the cropping and the flicker, and the flicker on Firefox/Android is intentionally left out of this PR. Consider switching to Refs #2411 (or splitting the issue) so the flicker stays tracked instead of getting auto-closed as resolved.

@Yann-P

Yann-P commented Aug 13, 2026

Copy link
Copy Markdown
Collaborator Author

Built the theme locally to confirm the SCSS compiles and the back-to-top rule now emits bottom: 2dvh in the compiled CSS. stylelint and prettier are clean on the changed file. dvh is already used in _sidebar-toggle.scss, so this is consistent with the rest of the codebase.

One heads-up: the PR body says Fixes #2411, which auto-closes the issue on merge. The issue covers both the cropping and the flicker, and the flicker on Firefox/Android is intentionally left out of this PR. Consider switching to Refs #2411 (or splitting the issue) so the flicker stays tracked instead of getting auto-closed as resolved.

I edited the issue to remove the part about flickering

@Yann-P
Yann-P requested a review from Carreau August 18, 2026 07:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Back to top button is cropped on mobile

2 participants