JakeSidSmith / react-fastclick

Fast Touch Events for React
https://www.npmjs.com/package/react-fastclick
MIT License
487 stars 41 forks source link

flickering #1

Closed morenoh149 closed 9 years ago

morenoh149 commented 9 years ago

I'm getting lots of flickering throughout my app after adding fastclick on iOS. Could you elaborate on where to use event.preventDefault() you mention in the readme

manosim commented 9 years ago

Hey @morenoh149! I managed to remove the flickering at react-cordova. So basically you can do something like that:

goToAboutPage: function (event) {
  event.preventDefault();
  this.transitionTo('about');
},

@JakeSidSmith can you confirm this?

JakeSidSmith commented 9 years ago

Yup, @ekonstantinidis is correct. Just call preventDefault on the event of the callback. :)

JakeSidSmith commented 9 years ago

Just found a nicer solution - you can set the css property -webkit-tap-highlight-color to transparent. Either target html, body (to prevent the flickering on all elements) or target the specific element you don't want to flicker e.g. button.

html, body {
  -webkit-tap-highlight-color: transparent;
}

Updated readme.

manosim commented 9 years ago

Yeap can confirm this works great! Tested on iOS! :+1: