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

Fix: Correct the navigation to anchor #17910

Merged
merged 2 commits into from
Jun 12, 2023

Conversation

Dedelweiss
Copy link
Contributor

@Dedelweiss Dedelweiss commented Jun 6, 2023

The browser compatibility of location.hash seems to be out of date. That's why in this fix, I suggest using history.replaceState.

Before:

Screen.Recording.2023-06-06.at.10.12.13.mov

After:

Screen.Recording.2023-06-06.at.13.46.20.mov

Fixes: #17182

@Dedelweiss Dedelweiss force-pushed the 17182-anchor-navigation-bug branch from 2ee3914 to 657ae6e Compare June 6, 2023 10:18
@Dedelweiss Dedelweiss force-pushed the 17182-anchor-navigation-bug branch from 657ae6e to bb16919 Compare June 6, 2023 11:26
@Dedelweiss
Copy link
Contributor Author

Dedelweiss commented Jun 6, 2023

Another solution would be to add a setTimeout() with the window.location.hash = ""; if we want to keep it.

@Dedelweiss Dedelweiss changed the title WIP Fix: Correct the navigation to anchor Fix: Correct the navigation to anchor Jun 6, 2023
@Dedelweiss Dedelweiss marked this pull request as ready for review June 6, 2023 12:18
@Florian3k
Copy link
Contributor

Thanks, that seems to be working fine. I left one suggestion.

I was wondering whether we could do something to not remove this part or URL, if user wants to link to specific section, but let's leave that for future work.

@Dedelweiss
Copy link
Contributor Author

Thanks, that seems to be working fine. I left one suggestion.

I was wondering whether we could do something to not remove this part or URL, if user wants to link to specific section, but let's leave that for future work.

Thank you for your feedback @Florian3k, yes I was wondering too,indeed it can be useful. I can take a look at it for another PR.

@ckipp01 ckipp01 merged commit 7694985 into scala:main Jun 12, 2023
Kordyjan added a commit that referenced this pull request Nov 21, 2023
Backports #17910 to the LTS branch.

PR submitted by the release tooling.
[skip ci]
@Kordyjan Kordyjan added this to the 3.3.2 milestone Dec 14, 2023
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.

Scaladoc: scaladoc anchor navigation can't handle some same page links
4 participants