[Question] Is it possible to scroll element into view until it's visible and can be clicked?
See original GitHub issueI have a use case in which I have a side nav that is scrollable and there is a fixed overlay element (the black rectangle in the image) that can hide items that clickable in the side nav:
I’m trying in my test to click on the “Test 2” link but it’s hidden by the overlay and I don’t see a way to scroll it into view until it visible and can be clicked, I tried to use scrollIntoViewIfNeeded
that doesn’t work.
Is there an existing API that can help in this case to scroll to the element until it visible and can be clicked?
Thanks!
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Element.scrollIntoView() - Web APIs | MDN
The Element interface's scrollIntoView() method scrolls the element's ancestor containers such that the element on which scrollIntoView() is ...
Read more >Scroll Element into View with Selenium - Stack Overflow
This answer is wrong. According to the specification for Selenium 2.0 WebElement.click() requires the element to be visible in order to click on ......
Read more >How to Scroll into view in Selenium Webdriver
In Selenium we can do this with scrollIntoView(true) which can scroll automatically till the specific element is not present.
Read more >Scroll a React component into view - Robin van der Vleuten
To scroll to the element with JavaScript, you can create a button which scrolls back the the top when a user clicks it....
Read more >HTML DOM Element scrollIntoView() Method - W3Schools
The scrollIntoView() method scrolls an element into the visible area of the browser window. Syntax. element.scrollIntoView(align). Parameters. Parameter ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yay! @nadavkaner, closing as per above, please feel free to open a new issue if it did not do the trick!
See issue #3105. Should be fixed in Playwright v1.8.0.