microsoft / microsoft/playwright-dotnet
[Bug]: ScrollMode.None is ignored by pointer actions
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 3k
- Forks
- 304
- Avg merge
- 20h 47m
- Merged PRs (30d)
- 6
Description
Version
1.62.0; also reproduced on main at bda416ee05fecee2720d853a78e7a3dfb898d9bc.
Steps to reproduce
The regression tests are in this tests-only commit, before any implementation changes:
git clone https://github.com/GalayM/playwright-dotnet.git
cd playwright-dotnet
git checkout 65bc912afc77ff18da3791f432c9a73f17180c15
dotnet run --project src/tools/Playwright.Tooling/Playwright.Tooling.csproj -- download-drivers --basepath .
dotnet build src/Playwright.Tests/Playwright.Tests.csproj -f net8.0
pwsh src/Playwright/bin/Debug/netstandard2.0/playwright.ps1 install chromium
dotnet test src/Playwright.Tests/Playwright.Tests.csproj -f net8.0 --filter FullyQualifiedName~ScrollOptionsTests
The essential call is Page.Locator("button").ClickAsync(new() { Scroll = ScrollMode.None, Force = true }) on a button below the viewport. The tests also cover Page, Frame and ElementHandle entry points, nested scrolling containers, and the other pointer actions exposing Scroll.
Expected behavior
With ScrollMode.None, an offscreen target should remain offscreen and a forced action should fail with an outside-of-viewport error. A non-forced click should time out without scrolling. ScrollMode.Auto and omitted Scroll should retain automatic scrolling.
Actual behavior
The action scrolls the target into view and succeeds. The public Scroll property exists, but Frame and ElementHandle omit scroll from the protocol message. Page's explicit option conversions also omit Scroll.
The regression fails at the assertion expecting PlaywrightException because the action returned successfully. Explicit Auto and omitted-value controls pass. This affects click, double-click, hover, tap, check/uncheck/setChecked, and drag-and-drop.
Environment
- Operating system: Windows, build 26200
- CPU: x64
- Browser: Chromium bundled with Playwright 1.62.0
- .NET: SDK 10.0.400, tests target net8.0
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the regression coverage in ScrollOptionsTests and inspect the Page, Frame, and ElementHandle pointer-action option conversions, especially the protocol messages they produce. Run the provided dotnet test command; done means ScrollMode.None remains honored across the listed pointer actions while Auto and omitted values retain automatic scrolling.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- testing-qa
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 72/100