You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
auto: Element.focus() makes the element scroll into view
none: Element.focus() doesn't make the scrolling behavior
smooth: Element.focus() makes the element come into view with smooth scrolling
scrollOptions refers to the scrollIntoViewOptions of Element.scrollIntoView().
Element.focus() currently triggers scrolling the element into view. The result is reasonable when focusing based on onkeydown. But when focusing by mouseover the element, focus event also triggers the scroll behavior.
Demo shows no scrolling behavior when focusing by mouseover. If the option isn't checked, it also shows the result of the default scroll behavior triggered by Element.focus().
It could be nice if we can disable the scrolling behavior when the focus is triggered by mouseover and for other use cases.
Customizing the scrolling behavior of Element.focus already been discussed in #834.
Also, similar discussion is in w3c/csswg-drafts#1388.
The text was updated successfully, but these errors were encountered:
Could Element.focus() have the scrollOption to define the scroll behavior?
Such as:
scrollOptions
refers to the scrollIntoViewOptions of Element.scrollIntoView().Element.focus() currently triggers scrolling the element into view. The result is reasonable when focusing based on
onkeydown
. But when focusing bymouseover
the element, focus event also triggers the scroll behavior.Demo shows no scrolling behavior when focusing by
mouseover
. If the option isn't checked, it also shows the result of the default scroll behavior triggered by Element.focus().It could be nice if we can disable the scrolling behavior when the focus is triggered by mouseover and for other use cases.
Customizing the scrolling behavior of Element.focus already been discussed in #834.
Also, similar discussion is in w3c/csswg-drafts#1388.
The text was updated successfully, but these errors were encountered: