Closed Bug 1729271 Opened 5 years ago Closed 5 years ago

Pressing enter when a anchor (#) is present, does not scroll the the target

Categories

(Core :: Layout: Scrolling and Overflow, defect)

Firefox 91
defect

Tracking

()

RESOLVED INVALID

People

(Reporter: marc.stirner, Unassigned)

References

Details

Attachments

(1 file)

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.

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.

Component: Untriaged → Panning and Zooming
Product: Firefox → Core
Component: Panning and Zooming → Layout: Scrolling and Overflow

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.

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.

Status: UNCONFIRMED → RESOLVED
Closed: 5 years ago
Resolution: --- → INVALID

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.

Attached image firefox-error.jpg —

Hmm... my bad.

The anchor name is not the same as in the url...

See Also: → 1831333
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: