-
Notifications
You must be signed in to change notification settings - Fork 9.3k
TouchScreen.tap #639
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TouchScreen.tap #639
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
overall looks good!
lib/ElementHandle.js
Outdated
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
test/assets/input/touches.html
Outdated
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems fine.
9dc6510 to
e3fbbbe
Compare
There was a problem hiding this 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']); |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it clears the result
|
I am waiting for swipe function,It may only be used now |
|
@JoelEinbinder thanks for your payout, how about the swipe, pinch and zoom events? when are they will be released? |
|
@JoelEinbinder Is swipe ready yet? |
it looks like no yet!! |
This adds a touchScreen input object with a
tapmethod, and an equivalenttapon elementHandle. In the future touchScreen with have methods likeswipe,pinchandzoom. The other methods are waiting on some backend work to make them less racy.#568 #569 #158