Skip to content

Prevent iframe from scrolling parent container #7134

@ms609

Description

@ms609

An iframe can cause its parent window to scroll to another position, for example using document.body.scrollIntoView();

There seems to be no way to override (prohibit) this behaviour under the present w3c specification. StackOverflow user Kaiido has suggested a solution that exploits a bug in Chrome, which raises the question as to whether a CSS solution to prevent cross-source scrolling would be possible.

Further details at the StackOverflow answer.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions