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

cuelang.org: clicking a same-page fragment link breaks the browser's usual "back" button behaviour #3615

Open
jpluscplusm opened this issue Dec 4, 2024 · 1 comment
Labels
cuelang.org frontend cuelang.org frontend UI/UX related NeedsInvestigation

Comments

@jpluscplusm
Copy link
Collaborator

What page were you looking at?

https://cuelang.org/docs/reference/modules/#resolve-pkg-mod

What version of the site were you looking at?

cue-lang/cuelang.org@af18aba

What did you do?

  • I was reading the section "Resolving a package to a module". Its first sentence contains a link to a glossary entry on the same page, linked from the words "package page".
  • I clicked on this link, and was taken to the glossary entry near the bottom of the same page. My browser URL was updated to include the fragment relating to the glossary entry.
  • I finished reading the glossary entry, and clicked my browser's "back" button to return to the paragraph that had linked me to the glossary.

What did you expect?

I expected the page to return to my previous position, right before I clicked the link to the glossary entry.

What did you see instead?

I was sent to the page which I had been reading before I visited the modules reference guide.

Extra info

I don't think I'm imagining that the expected behaviour I describe is the browser's normal behaviour.

For an example of this working as expected, visit this Docker documentation page; visit several of the right-hand-TOC entries; then use the "back" button to reverse back through the list of sections you just visited.

@JorindeUsMedia
Copy link
Collaborator

This is an easy fix:
For developer: in main.ts change window.history.replaceState(null, '', target); to window.location.href = target

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cuelang.org frontend cuelang.org frontend UI/UX related NeedsInvestigation
Projects
Status: Planned
Development

No branches or pull requests

2 participants