"Back to top" button tends to get in the way #435
-
When I click on an anchor next to a header, it puts that header at the top of the page. It also adds a "back to top" button at the top of the page. Since I am typically reading the text right under the anchor I just clicked, this "back to top" button tends to appear right on top of the content I am intending to read. More generally, the "back to top" thing does appear on top of the content often enough to be annoying. It also seems to disappear and reappear at random. I can't quite tell what the logic is. It seems that scrolling around sometimes makes it appear or disappear. Would it be possible to move the "back to top" button to the right sidebar, or somewhere else where it doesn't overlap with the content? I would also suggest making it not disappear, except maybe when the page is already scrolled to the top. Making it disappear should be unnecessary if it doesn't overlap on content. (And fwiw, I personally don't think the "back to top" button is needed at all, since it's not hard to scroll to the top of the page either on desktop by pressing "home" or "cmd-up" or on mobile by touching the top of the screen. But maybe I'm not a typical user in knowing these shortcuts.) |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
I think it appears when scrolling up, which makes sense. But unfortunately that also includes scrolling caused by clicking in the sidebar. For example, on the pip "Getting started" page, click the sidebar links in this order:
Result: I also find this irritating, so I've disabled it on my pages by adding this CSS: .show-back-to-top .back-to-top {
display: none;
} |
Beta Was this translation helpful? Give feedback.
-
This one slipped through the cracks. :)
@asmeurer Is this still the case? The logic right now is basically "has the viewport scrolled up on the last scroll event". FWIW, I agree that a scroll triggered by anchor navigation isn't a good place to show the "Back to top" button because the scroll isn't because the user is trying to scroll towards the top of the page. |
Beta Was this translation helpful? Give feedback.
-
I've tweaked margins since to ensure that there is very little overlap with content: https://pip.pypa.io/en/stable/getting-started/#ensure-you-have-a-working-pip for an example. |
Beta Was this translation helpful? Give feedback.
I've tweaked margins since to ensure that there is very little overlap with content: https://pip.pypa.io/en/stable/getting-started/#ensure-you-have-a-working-pip for an example.