Intersection Observer page auto-scrolls to embedded iframe on load

REOPENED
Assigned to

Status

REOPENED
2 years ago
2 years ago

People

(Reporter: agibson, Assigned: sheppy)

Tracking

Details

(Reporter)

Description

2 years ago
User Agent: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:56.0) Gecko/20100101 Firefox/56.0"
BuildID: "20170613030203"

STR:

Open: https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API

Expected results:

Once the page loads I should be able to start reading the document.

Actual results:

The page jumps straight down to the embedded CodePen, and I have to scroll all the way back up again.

It looks like it might be an issue with JS in the CodePen itself, calling `scrollIntoView` on `.wrapper`.
(Assignee)

Comment 1

2 years ago
I'll see what I can do.
Assignee: nobody → eshepherd
(Assignee)

Comment 2

2 years ago
It looks like this only happens in Chrome. I'll investigate further.
(Reporter)

Comment 3

2 years ago
(In reply to Eric Shepherd [:sheppy] from comment #2)
> It looks like this only happens in Chrome. I'll investigate further.

It happens in both Chrome and Firefox Nightly for me. You may just need to use a browser that supports Intersection Observer API to trigger the right code path.
(Assignee)

Comment 4

2 years ago
Actually happens in Firefox too, yeah. I've changed the code sample to scroll by getting the top of the first element in the wrapper and setting scrollTop based on that.
Status: NEW → RESOLVED
Last Resolved: 2 years ago
Resolution: --- → FIXED
(Reporter)

Comment 5

2 years ago
(In reply to Eric Shepherd [:sheppy] from comment #4)
> Actually happens in Firefox too, yeah. I've changed the code sample to
> scroll by getting the top of the first element in the wrapper and setting
> scrollTop based on that.

Hmm, I can confirm that the page no longer jumps on load, but now when I scroll down to the CodePen it doesn't show? (actually, it seems to be scrolled way out of view within its container, so it just appears invisible).
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
You need to log in before you can comment on or make changes to this bug.