Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I make CSS :active styles work on trackpad taps?

Most trackpads on laptops have a tap-to-click option/feature where light taps are recognized as presses (either pressing one of the trackpad buttons or pressing down on the trackpad surface on buttonless trackpads) and trigger a click. I've noticed on my Macbook Pro that CSS :active styles aren't applied to HTML elements if I tap on my trackpad; they're only applied if I press down on the trackpad and it clicks.

Is there a way to make trackpad taps (not mobile touchscreen taps) trigger the :active state?

like image 283
clickbait Avatar asked Sep 27 '16 02:09

clickbait


1 Answers

How events like these are registered (touch pad taps, and clicks) are processed by the operating system / the browser, and there isn't a way to register this through CSS/JS as danyamachine said it works on his device, this could because he was using a different browser that handles clicks vs taps differently

like image 150
Dylan Avatar answered Sep 19 '22 10:09

Dylan