-
Notifications
You must be signed in to change notification settings - Fork 970
Prevent two-finger swipe forard/back when scrolling on viewport #2553
Conversation
This commit can only prevent conflicts on non-inner scrollable element like I'm still working on the other cases like example in MDN |
does Chrome work any better? |
Chrome perform swipe forward/back based on reaching the edge of viewport. |
ipc.on('scroll-touch-begin', function () { | ||
trackingFingers = true | ||
startTime = (new Date()).getTime() | ||
}) | ||
ipc.on('scroll-touch-end', function () { | ||
if (trackingFingers && Math.abs(yVelocity) < 1) { | ||
if (!isScroll && trackingFingers && Math.abs(yVelocity) < 1) { | ||
if (xVelocity > 1.5) { |
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.
I think you can change the xVelocity threshold to 1 or 0.5 to make it easier to go back/forward now
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.
Thanks yan!
good idea |
about 656d56d:
|
Is IPC possible here? Just wondering why the console.log hack. Is it more efficient for some reason? |
@bbondy , your are right. I should use IPC. I just came up with console.log from nowhere. |
looks great, thanks! |
git rebase -i
to squash commits if needed.fix #2577