ftlabs / fastclick

Polyfill to remove click delays on browsers with touch UIs
MIT License
18.66k stars 3.22k forks source link

Deferred long-running timer task(s) to improve scrolling smoothness #482

Open fritx opened 8 years ago

fritx commented 8 years ago

image

Deferred long-running timer task(s) to improve scrolling smoothness. See crbug.com/574343.

When I use fastclick with Vue.js, some of the v-link elements (same as <a href>) requires a second click to work on Chrome Device Emulator, and logging this message after the fist click.

On real devices it is fine. And if I disable fastclick, it works well with Emulator. I'm not sure if this is a bug related to fastclick?

itamarro commented 8 years ago

I'm experiencing this as well. Haven't researched in depth yet.

fritx commented 8 years ago

@itamarro I finally wrote the following code, to make sure fastclick is applied only on mobile.

// https://github.com/adcentury/vue-weui/blob/master/examples/main.js
// https://github.com/ftlabs/fastclick/issues/482
// mobile only, avoid warnings 'Deferred long-running timer task(s) to improve scrolling smoothness'
if (process.env.NODE_ENV === 'production') {
  fastclick.attach(document.body)
}
itamarro commented 8 years ago

@fritx Thank you! So you're confident this issue does not reproduce outside the emulator?