webdriver
webdriver copied to clipboard
Scroll into view: scroll position `end` vs. `center`
The spec currently says that before interacting with an element, it needs to be scrolled into view:
To scroll into view an element perform the following steps only if the element is not already in view:
Let options be the following ScrollIntoViewOptions:
Logical scroll position "block" "end" Logical scroll position "inline" "nearest"
I would like to propose to change the position block from end to center given that many applications have fixed positioned elements at the bottom the screen, e.g.
- a footer element
- a cookie compliance model (e.g. https://amazone.de/de-de/)
- some sort of check out modal (e.g. https://coffee-cart.netlify.app/)
I'ld argue scrolling the element into the center of the viewpoint has higher chances that there are less elements that could be blocking the interaction causing element click intercepted errors.