-
Notifications
You must be signed in to change notification settings - Fork 2k
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
App-level support for passive gesture touch listeners #4829
Conversation
Hmm, looks like closure linting is broken on travis 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.
Tested this yesterday with LightHouse and inspected your smoke test. This seems to be working!
Set Polymer.passiveTouchGestures to true to enable
633fa25
to
6312da5
Compare
lib/utils/settings.html
Outdated
* | ||
* @memberof Polymer | ||
*/ | ||
Polymer.passiveTouchGestures = Polymer.passiveTouchGestures || false; |
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.
Should be a function for forward compatibility
lib/utils/gestures.html
Outdated
window.addEventListener('test', null, opts); | ||
window.removeEventListener('test', null, opts); | ||
} catch(e) {} | ||
})(); | ||
|
||
// decide whether to use {passive: true} for gestures listening for touch events | ||
let PASSIVE_TOUCH = Boolean(HAS_NATIVE_TA && SUPPORTS_PASSIVE && Polymer.passiveTouchGestures); |
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.
passiveTouchGestures
should be a function for forward compat.
Clean up event listener options inside gestures that use passive touch
This will ship as Polymer 2.1 |
Backport passive touch gestures #4829
This is labelled as being related to touch gestures, but will this also allow |
Apps can set
Polymer.passiveTouchGestures
totrue
to force all touch listeners for gestures to use passive event handlers.This may improve scrolling performance, at the cost of being unable to control scrolling with
gestureEvent.preventDefault()
.Instead, elements must use
Polymer.Gestures.setTouchAction(node, 'direction')
This PR overrules #4724
Fixes #4667
Fixes #3787
Fixes #3604