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

Race Condition in Anchor navigation #7826

Closed
cefn opened this issue Dec 17, 2022 · 4 comments
Closed

Race Condition in Anchor navigation #7826

cefn opened this issue Dec 17, 2022 · 4 comments
Labels
🐛 bug Something isn't working, or isn't working as expected need more info Further information is requested p3 We don't have visibility when this will be addressed. ux make the user experience awesome

Comments

@cefn
Copy link

cefn commented Dec 17, 2022

MDN URL

https://developer.mozilla.org/en-US/docs/Web/Progressive_web_apps/Introduction#re-engageability

What specific section or headline is this issue about?

Any anchored link

What information was incorrect, unhelpful, or incomplete?

I found that navigating directly to an anchor link only sometimes works. I am on Fibre broadband in the UK, but delays loading are still enough to introduce a race condition. My suspicion is that when the anchor is evaluated the content hasn't loaded, yet. This should be addressed by ensuring anchors are (re)evaluated after content load.

An example is as follows. Loading this URL should scroll directly to an inline anchor. However, it manages this only sometimes and more often than not it directly navigates to the head of the page as if there were no anchor.
https://developer.mozilla.org/en-US/docs/Web/Progressive_web_apps/Introduction#re-engageability

By contrast, navigating from links in the contents table of the Introduction page itself (after the page has already loaded) is successful and there is indeed an anchor in the page.

I first encountered this in Chrome by right-clicking from the contents table, and choosing to open an anchored link in a new tab (although I didn't know it was an anchor at the time). When I switched to the tab I found it hadn't navigated to any corresponding content at all.

What did you expect to see?

Navigation to anchors should work

Do you have any supporting links, references, or citations?

No response

Do you have anything more you want to share?

No response

@github-actions github-actions bot added the needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. label Dec 17, 2022
@wbamberg wbamberg transferred this issue from mdn/content Dec 17, 2022
@gaearon
Copy link

gaearon commented Dec 17, 2022

Not sure if it's the same issue, but I can consistently reproduce this fragment link not working in Chrome:

https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#methods

In other browsers, it scrolls to the anchor. But Chrome macOS consistently does not.

This feels pretty critical because MDN pages are long, and deep-linking to them is very valuable for external resources.

@caugner
Copy link
Contributor

caugner commented Dec 19, 2022

This sounds like #7168.

@cefn Would you be able to share a screen recording of the issue? That would be awesome. 🙏

@caugner caugner added 🐛 bug Something isn't working, or isn't working as expected p3 We don't have visibility when this will be addressed. ux make the user experience awesome need more info Further information is requested and removed needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. labels Dec 19, 2022
@cefn
Copy link
Author

cefn commented Dec 20, 2022

I'm not sure there's a whole lot of value sharing a screencast of a behaviour that doesn't happen. Believe me, navigating to a URL with a hash is identical to navigating to the plain URL, which is easy to reproduce.

@caugner
Copy link
Contributor

caugner commented Dec 20, 2022

No worries, closing in favor of #7168.

@caugner caugner closed this as not planned Won't fix, can't repro, duplicate, stale Dec 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working, or isn't working as expected need more info Further information is requested p3 We don't have visibility when this will be addressed. ux make the user experience awesome
Projects
None yet
Development

No branches or pull requests

3 participants