Skip to content

Conversation

@JoelEinbinder
Copy link
Contributor

@JoelEinbinder JoelEinbinder commented Aug 31, 2017

This adds a touchScreen input object with a tap method, and an equivalent tap on elementHandle. In the future touchScreen with have methods like swipe, pinch and zoom. The other methods are waiting on some backend work to make them less racy.

#568 #569 #158

Copy link
Contributor

@aslushnikov aslushnikov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

overall looks good!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

jsdoc

docs/api.md Outdated
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we explain what's a tap?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A concise and effective definition: https://api.jquerymobile.com/tap

docs/api.md Outdated
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we also have page.tap() similarly to page.click()?

docs/api.md Outdated
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the page.touchScreen feels slightly weird. Paul, any naming ideas? @paulirish

Copy link
Contributor Author

@JoelEinbinder JoelEinbinder Aug 31, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can do page.touchscreen, all lowercase because apparently touchscreen is one word

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't we have the same asset for mouse? Can we unify the two, simply recording all the events for the button?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a similar one for keyboard, but it has a textarea.

test/test.js Outdated
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is is actually ok to send touches to the non-touch viewport?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems fine.

Copy link
Contributor

@aslushnikov aslushnikov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great patch, thanks.

await page.goto(PREFIX + '/input/touches.html');
const button = await page.$('button');
await button.tap();
expect(await page.evaluate(() => getResult())).toEqual(['Touchstart: 0', 'Touchend: 0']);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of curiosity, how's getResult() different from result? You use one in the first test and other in the second

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it clears the result

@aslushnikov aslushnikov merged commit 64124df into puppeteer:master Sep 2, 2017
@LLLLLamHo
Copy link

I am waiting for swipe function,It may only be used now evaluate function in the browser use JavaScript to simulate swipe function.

@Genuifx
Copy link

Genuifx commented Nov 20, 2017

@JoelEinbinder thanks for your payout, how about the swipe, pinch and zoom events? when are they will be released?

@KartikKumarSahoo
Copy link

@JoelEinbinder Is swipe ready yet?

@MTTTM
Copy link

MTTTM commented May 23, 2021

@JoelEinbinder Is swipe ready yet?

it looks like no yet!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants