You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[CLI]: Negative positional arguments are parsed as flags, breaking mousewheel scroll-up #42321
Exit code 1, and the page receives no wheel event at all (verified with a
capture-phase wheel listener counting by sign: up stays 0, scrollY unchanged).
Since mousewheel <dx> <dy> takes both deltas as positional arguments, scrolling
up is unreachable through this command.
Expected
mousewheel 0 -100 scrolls up.
Root cause
packages/playwright-core/src/tools/cli-client/minimist.ts: -100 matches the
short-flag branch /^-[^-]+/, which has no escape for numeric arguments, so the
value never reaches _:
The vendored parser inherits this from minimist, but the CLI pairs it with commands
whose positional arguments are legitimately signed, so any negative positional is
unreachable — not just wheel deltas.
Treat an argument matching /^-\d/ (or the numeric pattern already used inside that
branch) as positional, the way commander and yargs do. Related positional-parsing
fixes on the same parser: #39148, #39215.
Also worth noting: the bundled skills/playwright-cli/SKILL.md only ever shows mousewheel 0 100, so an agent following it hits this the first time it needs to
scroll up.
Activity
bytedragondance commentedon Aug 20, 2026
I would be happy to send a small fix with a focused regression test if this is approved for a community contribution.