-
Notifications
You must be signed in to change notification settings - Fork 25.9k
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 smooth scroll breaking back button #1767 #1786
Conversation
Is there any way to make the URLs that appears in the browser bar match the ones on the page? When testing this fix on the Where as |
Yeah, I noticed that too. However, I honestly don't have much experience with JavaScript. I just copied the code snippet you posted, which was from the link I gave to you. If you know how not to add an extra slash, you can tell me and I'll update the PR.
They do scroll down for me. |
They scroll for me when clicking fine. What I'm concerned about is if those links get indexed or shared and someone clicks on it from an external source or different page, then it doesn't load at the proper heading. It just starts at the top of the page. I'll take a look at the script and see if I can alter the regex to keep |
How did you test it? The way I tested was by copying the link with a hash and pasting in a new tab (not in the current tab). And the loaded page started at the section the hash referred to. |
|
Digging into this further on jQuery Smooth Scroll GH issues, seems like there are legit reasons to doing I'd be fine with that solution, but I still don't like that they won't work if JS is disabled. Which is probably rare these days, but still. I also don't like how there's a mixture of different path types. In the raw HTML you get Still digging around to see if there are other options. Some of the solutions I've found mention using jQuery BBQ, but I'd like to avoid throwing even more JavaScript at the problem. |
This issue has been automatically marked as stale because it has not had recent activity. If this is a bug and you can still reproduce this error on the If this is a feature request, please consider whether it can be accomplished in another way. If it cannot, please elaborate on why it is core to this project and why you feel more than 80% of users would find this beneficial. This issue will automatically be closed in 7 days if no further activity occurs. Thank you for all your contributions. |
Fix #1767.