Skip to content

The behaviour for repeated calls to focus({ preventScroll }) should be clarified #4512

@mbrodesser

Description

@mbrodesser

As I've started implementing the support of the { preventScroll : true } to the focus(options) method of elements (https://html.spec.whatwg.org/#dom-focusoptions-preventscroll) for Firefox, I've noticed the behaviour for repeated focus calls should be clarified in the spec to avoid interoperability problems. Currently, Chrome doesn't re-focus when an element is already focused.

For instance:
data:text/html,<style> input { margin-top: 40cm } </style> <input type="text" id="i1"> <script> document.getElementById("i1").focus({ preventScroll: true }); document.getElementById("i1").focus({ preventScroll: false }) </script>

won't scroll down for the second call to focus. If this is considered desirable behaviour, it should be in the spec.

Metadata

Metadata

Assignees

No one assigned

    Labels

    interopImplementations are not interoperable with each othertopic: focus

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions