Pressing enter when a anchor (#) is present, does not scroll the the target
Categories
(Core :: Layout: Scrolling and Overflow, defect)
Tracking
()
People
(Reporter: marc.stirner, Unassigned)
References
Details
Attachments
(1 file)
|
230.00 KB,
image/jpeg
|
Details |
User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:91.0) Gecko/20100101 Firefox/91.0
Steps to reproduce:
Visit a url with anchor e.g. https://github.com/prettier/eslint-config-prettier#installation, scroll around the page, away from the target, focus on the address bar, hit enter.
Duplicate, since there is a bug report open since 6 Years: https://bugzilla.mozilla.org/show_bug.cgi?id=1239653
This bug existed in previous versions of Firefox, was then fixed & exists now again.
Tested/Found on Firefox 91.0.2 (64 Bit), Ubuntu 20.04 LTS x64
Actual results:
Nothing.
Expected results:
Scroll to the anchor target.
Comment 1•5 years ago
|
||
The Bugbug bot thinks this bug should belong to the 'Core::Panning and Zooming' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.
Updated•5 years ago
|
Comment 2•5 years ago
|
||
Chrome seems to reload the page but it restores the same scroll position, it does not scroll toe the "installation" anchor for me. Safari seems to reload and scroll to the anchor.
Comment 3•5 years ago
|
||
I think this is invalid, the element doesn't have the right name / id.
document.getElementById("installation") // null
document.querySelector("[name=installation]") // null
The id is user-content-installation, so it seems GitHub is trying to manage the anchor scrolling itself, and that's causing this.
Pressing enter in the address bar doesn't cause a navigation in Firefox, but that's known behavior difference from Chrome / WebKit.
| Reporter | ||
Comment 4•5 years ago
|
||
Im not sure if i understand you correctly.
There is a id with the anchor name on the page, see screenshot.
If you click on the link, Firefox scrolls to the Installation section, as it should be.
But now scroll a bit down, focus the address bar, hit enter and see what happens. Nothing.
| Reporter | ||
Comment 5•5 years ago
|
||
| Reporter | ||
Comment 6•5 years ago
|
||
Hmm... my bad.
The anchor name is not the same as in the url...
Description
•