Skip to content

feat(actions): add scroll option to opt out of autoscroll#41433

Merged
pavelfeldman merged 1 commit into
microsoft:mainfrom
pavelfeldman:feat-41421
Jun 23, 2026
Merged

feat(actions): add scroll option to opt out of autoscroll#41433
pavelfeldman merged 1 commit into
microsoft:mainfrom
pavelfeldman:feat-41421

Conversation

@pavelfeldman

Copy link
Copy Markdown
Member

Summary

  • Adds a scroll option ("auto" | "none", default "auto") to pointer-based actions (click, dblclick, hover, tap, dragTo/dragAndDrop, check, uncheck, setChecked) on Locator, Page, Frame and ElementHandle.
  • scroll: 'none' skips scrolling the element into view (including nested overflow containers); the action fails if the element is not already in the viewport. Useful to assert an element is reachable without extra scrolling.

Fixes #41421

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

Adds a `scroll` option (`"auto"` | `"none"`) to pointer-based actions
(click, dblclick, hover, tap, dragTo/dragAndDrop, check, uncheck,
setChecked) across Locator, Page, Frame and ElementHandle. When set to
`"none"`, Playwright does not scroll the element into view and the action
fails if the element is not already in the viewport, including not
scrolling nested overflow containers.

Fixes: microsoft#41421
@pavelfeldman
pavelfeldman merged commit 1b3da20 into microsoft:main Jun 23, 2026
45 of 46 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

Test results for "MCP"

7380 passed, 1122 skipped


Merge workflow run.

@github-actions

Copy link
Copy Markdown
Contributor

Test results for "tests 1"

2 failed
❌ [chromium-library] › library/browsercontext-add-init-script.spec.ts:28 › should work without navigation, after all bindings @chromium-ubuntu-22.04-arm-node20
❌ [chromium-library] › library/browsercontext-expose-function.spec.ts:77 › should be callable from-inside addInitScript @chromium-ubuntu-22.04-arm-node20

1 flaky ⚠️ [chromium-library] › library/video.spec.ts:717 › screencast › should work with video+trace `@chromium-ubuntu-22.04-node24`

49041 passed, 1142 skipped


Merge workflow run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: locator.click() auto-scrolls tiny nested overflow containers, hiding UX regressions from tests

2 participants