Back to Puppeteer

Mouse.dragAndDrop() method

website/versioned_docs/version-24.40.0/api/puppeteer.mouse.draganddrop.md

19.2.2872 B
Original Source

Mouse.dragAndDrop() method

Performs a drag, dragenter, dragover, and drop in sequence.

Signature

typescript
class Mouse {
  abstract dragAndDrop(
    start: Point,
    target: Point,
    options?: {
      delay?: number;
    },
  ): Promise<void>;
}

Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead> <tbody><tr><td>

start

</td><td>

Point

</td><td>

point to drag from

</td></tr> <tr><td>

target

</td><td>

Point

</td><td>

point to drop on

</td></tr> <tr><td>

options

</td><td>

{ delay?: number; }

</td><td>

(Optional) An object of options. Accepts delay which, if specified, is the time to wait between dragover and drop in milliseconds. Defaults to 0.

</td></tr> </tbody></table>

Returns:

Promise<void>