Skip to content
This repository has been archived by the owner on Mar 19, 2018. It is now read-only.

Add library to make touch listeners passive by default #38

Open
RByers opened this issue May 2, 2016 · 0 comments
Open

Add library to make touch listeners passive by default #38

RByers opened this issue May 2, 2016 · 0 comments

Comments

@RByers
Copy link
Member

RByers commented May 2, 2016

Thinking about how to make it easier to get the perf benefits of passive touch listeners, I'm thinking it would be helpful to publish a sample library which makes all touch listeners passive by default unless requested otherwise.

In particular, we could hook addEventListener and set the passive option automatically for touchstart or touchmove unless the target element has a blocksScroll class applied to it or something.

I'm sure there would be scenarios where naive usage of this causes some subtle breakage (eg. carousels that pan without disabling scrolling) but it would probably be pretty minor in practice often easily addressed by the application of touch-action. Such issues are probably better than the alternative of such sites just having scroll jank issues, and likely even better than those sites getting impacted by our intervention (WICG/interventions#18).

Thoughts?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant