Contact emails
Spec
https://github.com/whatwg/html/pull/2787
Summary
This adds an optional focusOptions argument to Element.focus() API. The additional argument allows to control the scrolling behavior when scroll the element into view, such as prevent scroll or smooth scroll.
Motivation
Currently, there’s no way to request the scrolling to be smooth or request no scrolling when calling Element.focus(). Since the scrollIntoView already implemented smooth scroll, it’s reasonable for focus to have similar scroll options. Disable scrolling have use cases such as: JS is focusing an element based on pointer hover(for TV). Web developer are forced to use some trick to block scrolling. See discussion in: https://github.com/whatwg/html/issues/834
Interoperability and Compatibility Risk
Edge:No signals
Firefox:In development Link
Safari: No signals
Web developers: Positive Link
Ongoing technical constraints
None
Will this feature be supported on all six Blink platforms (Windows, Mac, Linux, Chrome OS, Android, and Android WebView)?
Yes.
OWP launch tracking bug
Link to entry on the feature dashboard
https://www.chromestatus.com/feature/5745122025144320
Requesting approval to ship?
No