Skip to content
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

passiveTouchGestures probably shouldn't apply to touchend #4961

Closed
RByers opened this issue Nov 29, 2017 · 1 comment
Closed

passiveTouchGestures probably shouldn't apply to touchend #4961

RByers opened this issue Nov 29, 2017 · 1 comment

Comments

@RByers
Copy link

RByers commented Nov 29, 2017

Touch scrolling is designed to be fast when touchstart and touchmove listeners are passive, but it's fine for touchend to be non-passive (since it doesn't block scrolling). See here for some details including:

Although it's still necessary to do so for mobile Safari, websites should not rely on calling preventDefault() inside of touchstart and touchmove listeners as this is no longer guaranteed to be honored in Chrome. Developers should apply the touch-action CSS property on elements where scrolling and zooming should be disabled to notify the browser before any touch events occur. To suppress the default behavior of a tap (such as the generation of a click event), call preventDefault() inside of a touchend listener.

From code inspection it looks to me like Polymer's passiveTouchGestures feature (#3604) sets all touch listeners to passive, including touchend. This will make adoption harder because it disables the ability to suppress click events. See for example b/66423965 inside Google.

Perhaps passiveTouchGestures can simply be updated to apply only to touchstart and touchmove listeners?

/cc @azakus @dtapuska

@dfreedm
Copy link
Member

dfreedm commented Nov 29, 2017

Ah, I missed this guidance somehow!
I'm totally fine making this change as it removes most of the tradeoffs, thanks!

dfreedm added a commit that referenced this issue Nov 29, 2017
`touchend` listeners do not need to be passive to enable more performant
scrolling.

With this change, most of the tradeoffs with enabling
`passiveTouchGestures` disappear, leaving only the inability to control
scrolling from `track`, `down`, and `move` gestures.

Fixes #4961
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants