Skip to content

drag and left_mouse skip cursor positioning when a coordinate is 0 (screen edge) #7079

Open

Description

@abhay-codes07

What happened

drag and left_mouse in skyvern/webeye/actions/handler_utils.py gate the move-to-start on a truthiness check:

async def drag(page, start_x=None, start_y=None, path=None):
    if start_x and start_y:                       # 0 is falsy
        await EventStrategyFactory.move_cursor(page, start_x, start_y)
    ...

async def left_mouse(page, x, y, direction):
    if x and y:                                   # 0 is falsy
        await EventStrategyFactory.move_cursor(page, x, y)

A coordinate of 0 (the top or left screen edge) is falsy, so the cursor is never moved before mouse.down(). The drag or click then fires at wherever the cursor happened to be, not at the requested edge coordinate. drag even uses is not None for the very same start_x/start_y a few lines later (setting last_x/last_y and the final sync_cursor_position), which shows the intended check.

Expected

Coordinate 0 is a valid position and should move the cursor. Use is not None so only a missing coordinate skips the move.

Reproduce

Calling drag(page, start_x=0, start_y=5) never invokes move_cursor, so the drag starts from the previous cursor position instead of (0, 5). Same for left_mouse(page, 0, 0, "down").

I have a fix plus tests ready and will open a PR that references this issue.

Activity

  1. self-assigned this
    on Jul 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions