react-fastclick icon indicating copy to clipboard operation
react-fastclick copied to clipboard

Css :active not fired onTouchStart

Open Aarbel opened this issue 6 years ago • 5 comments

Hi react-fastclick team !

Problem

HTML

<button>
    Hello
</button>

CSS

button:active {
    background-color : red;
}
  • Button:active pseudo-class isn't fired instantly on onTouchStart when react-fastclick is installed.
  • The button:active is fired with a 300ms delay, when the button is hold.
  • If the user taps fast, he doesn't see the style change.

Expected behavior

Css :active pseudo-class is commonly fired on onTouchStart. We use this pseudo class to make our interface more appealing on mobile devices (we use Cordova). Each time our user touchStart a button, the style instantly changes to make the interface more "reactive".

How to reproduce

How to reproduce :

  • install react-fastclick
  • enjoy tapping on an element with :active pseudo class
  • i use an Iphone, i didn't tried on Android if the problem is similar

How could we fix this issue ?

Thanks !

Aarbel avatar Oct 06 '17 17:10 Aarbel

Hello, I also encountered the same problem, please ask this question, you have found a solution?

henrysworld avatar Oct 25 '17 02:10 henrysworld

Hey, sorry, somehow I didn't notice this issue. Will have a look whenever I get a chance. :)

JakeSidSmith avatar Oct 25 '17 08:10 JakeSidSmith

@Aarbel could you fork from this branch: https://github.com/JakeSidSmith/react-fastclick/pull/56 and try to reproduce. Send me a link in reply to this issue and let me know what iPhone & version of iOS the issue appears on. I have tried to reproduce on several iPhone simulators, but don't appear to be able to.

JakeSidSmith avatar Oct 29 '17 15:10 JakeSidSmith

@JakeSidSmith which iPhone simulator do you use ? Thanks a lot for your corrections, i'll test it next week ;)

Aarbel avatar Nov 03 '17 20:11 Aarbel

@Aarbel might also be worth trying out the original https://github.com/ftlabs/fastclick as it appears to work nicely with React now. I may end up deprecating this library in favor of ftlabs' fastclick.

JakeSidSmith avatar Nov 04 '17 22:11 JakeSidSmith