-
-
Notifications
You must be signed in to change notification settings - Fork 8.5k
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
the backtotopbutton only shows when scrolling up slightly after scrolling down #10135
Comments
@homotechsual It has been designed that way on purpose in #4912 I'm not against changing it but is it really an improvement considering the button is already quite useless and most modern docs solutions do not have one? For example VuePress had it, and VitePress doesn't have it, probably because it's not that useful. Do we really want to distract the reading experience with a button that appears? Showing on scroll up is less likely to be distracting so I'm in favor of keeping the current behavior, although it may looks surprising. |
There's a certain logic there. The current behaviour feels less discoverable and less intuitive for a user. I'd probably lean towards saying remove it altogether rather than have the current behaviour or make the behaviour (and presence altogether) configurable. |
If a user wants to scroll at the top, he has to scroll up. So, the way to go to the top would actually permit you to discover the feature 😄 . Have people actually complained about it? Like they didn't know the feature existed or something? Removing it could annoy some users. Making it configurable could feel a bit overkill. People that don't like this behavior can swizzle the theme component. If nobody swizzled it to implement another behavior, this is probably because the current behavior is not annoying enough for people to take action. Has anyone in our whole community ever swizzled to disable the button, or change its scroll behavior? If that's the case, I'm more likely to add an option because there's proof the community would use it. |
These are good questions. It's come up once so far on Discord (which is what prompted this issue) I'm not aware of other discussions - not that that is in and of itself a sign of anything other than I haven't seen them :-) |
Maybe before introducing an option, what we could do is to add that option to the theme-common hook first, so that people can apply the customization easily through swizzle? What would be a good API (for both hook + themeConfig) to make this configurable? type ScrollToTopConfig = {appearOn: "scroll" | "scroll-up", threshold: number} | null ??? |
I don't agree this kind of core UX should be customizable. It's a deliberate design decision and gives Docusaurus sites a uniform touch, just like sidebar interactions. I don't think there's sufficient controversy on this to justify extra API surface. |
Agree with @Josh-Cena , let's close this for now. Users can implement this in userland through swizzle. If we see a few sites unhappy enough about our current behavior to override it through swizzle, this means there is enough traction. Until then, the current behavior is good enough. |
Have you read the Contributing Guidelines on issues?
Prerequisites
npm run clear
oryarn clear
command.rm -rf node_modules yarn.lock package-lock.json
and re-installing packages.Description
After scrolling down the back to top button doesn't show unless you scroll up slightly.
Reproducible demo
No response
Steps to reproduce
Expected behavior
The button should appear once scrolling down past the threshold without the need to scroll up slightly.
Actual behavior
The button doesn't appear until you scroll up again slightly.
Your environment
Self-service
The text was updated successfully, but these errors were encountered: