Skip to content

Embed player will make the parent page scroll when loading #1458

@lionep

Description

@lionep

Describe the issue
In a long page, with the embed player out of the main view, the parent page will autoscroll to the video when iframe is loaded

To Reproduce
Steps to reproduce the issue:

  1. Create a long HTML page body: { height: 5000px; }
  2. Place an embed player iframe in it, out of view : <iframe style="position: absolute; top: 4000px" ... />
  3. Open page and reload page
  4. See error : parent page will autoscroll to center iframe in view

Expected behavior
Parent page should not be controlled by iframe

Environment:

  • OS: mac OS
  • Browser : chrome

Additional context
Line of code possibly responsible for this behavior :

videoElement.scrollIntoView({
behavior: 'smooth',
block: 'center',
inline: 'nearest'
});

Related issue from W3C : w3c/csswg-drafts#7134

A query param to control this behavior would be a nicetohave, if it's a wanted feature.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions