I'm currently applying toggleClass
(to change colors) on each row of my table:
$('tr').click(function() {
$(this).toggleClass('red-c blue-c');
});
This works great on my desktop - as soon as I click on a row, the color toggles. However, on mobile, when I tap on a row, the row stays selected and the color doesn't toggle immediately. It toggles only after I tap on a second row.
I tried using the "touch" and "touchstart" events. Still no luck. The issue I think is that when I tap on a row, it stays selected / highlighted. It's only when I click on a different row that it gets unselected and toggles color.