diff --git a/packages/puppeteer-core/src/common/Input.ts b/packages/puppeteer-core/src/common/Input.ts index 12dfb5d02ad..67e97020e41 100644 --- a/packages/puppeteer-core/src/common/Input.ts +++ b/packages/puppeteer-core/src/common/Input.ts @@ -478,18 +478,14 @@ export class Mouse { options: MouseOptions & {delay?: number} = {} ): Promise { const {delay = null} = options; + await this.move(x, y); + await this.down(options); if (delay !== null) { - await this.move(x, y); - await this.down(options); await new Promise(f => { return setTimeout(f, delay); }); - await this.up(options); - } else { - await this.move(x, y); - await this.down(options); - await this.up(options); } + await this.up(options); } /**