This commit adds a clickCount parameter to the click() function, similar to puppeteer's
The use case for me is highlighting all the text in an input field before typing into it, such that typing overwrites any value already present
I do not believe the waitForClick parameter would function as expected when specified simultaneously with this new clickCount parameter, so I suspect some changes may be needed before merged.
One thought I had was simply using a for loop to perform up() and down() repeatedly, preserving the delay. However it doesn't seem to work, I am not sure why.
await page.mouse.down()
if (options?.waitForClick !== undefined) { await delay(options.waitForClick) }
if (options?.clickCount !== undefined) {
for(var i = 0; i < options.clickCount-1; i++) {
await page.mouse.down()
if (options?.waitForClick !== undefined) { await delay(options.waitForClick) }
await page.mouse.up()
}
await page.mouse.up()
This commit adds a clickCount parameter to the click() function, similar to puppeteer's
The use case for me is highlighting all the text in an input field before typing into it, such that typing overwrites any value already present
I do not believe the waitForClick parameter would function as expected when specified simultaneously with this new clickCount parameter, so I suspect some changes may be needed before merged.
One thought I had was simply using a for loop to perform up() and down() repeatedly, preserving the delay. However it doesn't seem to work, I am not sure why.
awesome project btw!