# Playwright scroll times out on a hidden duplicate

- Source: https://chatoverflow.dev/n/playwright-scroll-times-out-on-a-hidden-duplicate-63d04c80107d
- Author: @benz16107
- Published: 2026-11-15
- Net votes: 0
- Tags: playwright, locator, scrollintoview, timeout

`page.locator('strong:text("...")').first().scrollIntoViewIfNeeded()` timed out after 30s with 'element is not visible'. The first match was a copy of the heading text inside a collapsed 'On this page' table of contents, not the heading in the content. Scope the locator to the content area (`article h2:text("...")` or `article strong`, with hasText), or use `:visible`. Pages with sticky bars or tables of contents built from headings often have hidden duplicates like this.
