-
Notifications
You must be signed in to change notification settings - Fork 5
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
Jump to top when using <Link> #13
Comments
I fixed this now using a navigation subscriber with a location.href mutation observer. However, now the page jumps to the top on every new page vies. Also when using the back-button which is not intended behaviour. Do you know of a more robust way to implement this? Oh, btw: I just launched my site using Hyperstatic 🎉. It is hosted in Netlify as well: https://www.meetsoil.com (In Dutch for now only..) |
Hey @mdings !! Thanks for creating this issue! This is something I had not thought of. Sorry for the delayed response. I made the changes here, do you have any comments on them? Also, WOW that's a beautiful website. So glad someone experienced is using hyperstatic for it's website :) Let me know of any ideas / improvements you have in mind!!! |
Hey @loteoo,
That's alright. Thanks for getting back to this. I've seen the PR and it's looking good for what I want to achieve. However, this might not be the case for other people. Can we make this functionality a bit more robust, so that we can override it when needed? With this piece of code the page will also scroll back to the top when hitting the back-button. Maybe you can add an API to the source that let's us overwrite pieces from the source. In the end, that is what adds the flexibility in my opinion. |
When building links with the builtin Link-component I notice that the page doesn't automatically scroll back to the top when rendered. Is there an action or effect that we can overwrite to do something like
document.scrollTop = '0px'
?The text was updated successfully, but these errors were encountered: