-
Notifications
You must be signed in to change notification settings - Fork 30
Open
Labels
bugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomers
Description
Because of this line:
compute-scroll-into-view/src/index.ts
Line 259 in 9b4e9e6
const scrollingElement = document.scrollingElement || document.documentElement |
Here it accesses document
as a global, but when you execute this function from the iframe's parent's context, the document outside of the iframe is selected which results in the wrong behavior.
I think instead of getting document
as a global here, we can also get it from the element directly.
So that would become something like:
const targetDocument = target.ownerDocument!
const scrollingElement = targetDocument.scrollingElement || targetDocument.documentElement
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomers