[Bug]: `scrollIntoViewIfNeeded` does not work for nested popover elements
Version
1.56.1
Steps to reproduce
- clone https://github.com/alexaka1/repro-pw-popover-scroll
-
npm install -
npm run test:e2e - Observe failure, optionally view the generated trace
Expected behavior
The page contains a sidebar with a button, which opens a small context menu with buttons. The sidebar is scrollable, all the buttons are visible on small screens when scrolled.
Playwright should scroll the sidebar more to see the button.
Both tests should succeed.
Actual behavior
Playwright fails to do any scrolling and the click action fails.
Manual scrolling a little and then clicking the button works.
Additional context
I may be missing something, but I would expect this to work with no gymnastics.
Environment
System:
OS: macOS 15.7.1
CPU: (12) arm64 Apple M4 Pro
Memory: 104.08 MB / 48.00 GB
Binaries:
Node: 24.11.0 - /Users/alexaka1/.local/state/fnm_multishells/10269_1762434415469/bin/node
Yarn: 1.22.22 - /Users/alexaka1/.local/state/fnm_multishells/10269_1762434415469/bin/yarn
npm: 11.6.1 - /Users/alexaka1/.local/state/fnm_multishells/10269_1762434415469/bin/npm
pnpm: 9.15.6 - /Users/alexaka1/.local/state/fnm_multishells/10269_1762434415469/bin/pnpm
bun: 1.3.1 - /opt/homebrew/bin/bun
IDEs:
VSCode: 1.105.1 - /opt/homebrew/bin/code
Cursor: 1.4.5 - /opt/homebrew/bin/cursor
Codex: 0.55.0 - /Users/alexaka1/.bun/bin/codex
opencode: 1.0.35 - /Users/alexaka1/.bun/bin/opencode
Languages:
Bash: 3.2.57 - /bin/bash
npmPackages:
@playwright/test: 1.56.1 => 1.56.1
@alexaka1 Thank you for the issue, I can reproduce. Unfortunately, scrolling this button into view does not work in Chrome and Safari. Perhaps there's a spec problem with nested popovers that's not fixed in the browsers yet. I don't think we can do anything meaningful here, until browsers figure it out.