playwright icon indicating copy to clipboard operation
playwright copied to clipboard

[Bug]: `scrollIntoViewIfNeeded` does not work for nested popover elements

Open alexaka1 opened this issue 2 months ago • 1 comments

Version

1.56.1

Steps to reproduce

  1. clone https://github.com/alexaka1/repro-pw-popover-scroll
  2. npm install
  3. npm run test:e2e
  4. 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 avatar Nov 06 '25 14:11 alexaka1

@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.

dgozman avatar Nov 07 '25 21:11 dgozman