Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Question] Is it possible to scroll element into view until it's visible and can be clicked?

See original GitHub issue

I 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?


Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

pavelfeldmancommented, Jan 22, 2021

Yay! @nadavkaner, closing as per above, please feel free to open a new issue if it did not do the trick!

dgozmancommented, Jan 21, 2021

See issue #3105. Should be fixed in Playwright v1.8.0.

Read more comments on GitHub >

github_iconTop 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 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found