Skip to content
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

Select anchor from location.hash on page load #3623

Merged
merged 1 commit into from Dec 3, 2016

Conversation

Sija
Copy link
Contributor

@Sija Sija commented Dec 2, 2016

This PR fixes scrolling to section given in URI hash (like in https://crystal-lang.org/api/0.20.0/Array.html#clear-instance-method). This works around bug which resets container scroll on page refresh.

@asterite
Copy link
Member

asterite commented Dec 3, 2016

Thanks!!

Do you have any idea why hitting the "back" browser button doesn't work well? Since you fixed this issue maybe you understand why this happens.

The steps to reproduce are:

  1. Click on an anchor
  2. Hit the back button (it doesn't take you back)

@asterite asterite merged commit f802c37 into crystal-lang:master Dec 3, 2016
@Sija
Copy link
Contributor Author

Sija commented Dec 3, 2016

@asterite For me the steps would be:

  1. ... (the same)
  2. Hit back button
  3. Hit forward button (it doesn't take you back to the selected anchor from step no. 1)

Honestly I don't know what's the real cause of this issue :/ Closest thing I've found related to the issue at hand would be this SO question: http://stackoverflow.com/questions/27046851/browser-back-button-does-not-work-for-anchor-links.

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.

None yet

2 participants