Not sure about posting code since it's NDA'd, so I can't even show the current dev site as it's still under development, but essentially what's going on is that removeClass() is not working until the next click. So let's say there's a click event, where if you click a previous unselected item, it does addClass("active"), and if you click it again it does removeClass("active").
Problem is, while the addClass() effects are immediately apparent (background color changes), the removeClass() effects (revert background color) do not occur until you click on the screen somewhere, anywhere, but only in Chrome and Firefox. In IE the behavior is exactly as it should be.
The click event is bound with
$(".relevantItems").bind("click", function(){
if ($(this).hasClass("active")){
$(this).removeClass("active");
} else{
$(this).addClass("active");
}
});
So it's pretty straightforward. There must be something on the page that is causing this weird behavior, but I have no idea what it could be, as there's no other events that are bound to the relevant items. Any idea what I should be looking for that might be causing this behavior?
EDIT - It seems this is only doing this on my Surface Pro 3 (Chrome and Firefox are not in App Mode, whereas IE is. I'll pop Chrome to app mode and see what happens... but either way this is still a problem).
EDIT 2 - Confirmed working on all desktops and laptops in the office, except on Chrome and Firefox on the Surface Pro 3, even in native app mode. Anyone know what the tag for the surface is, as this seems to be device specific? Notably I have a hunch my switching Chrome and Firefox into the default app mode browser earlier may have caused a surface bug that is causing this, because when I switched them out of native app mode I couldn't even type in either browser. Working on iPad as well.
EDIT 3 - Figured it out, sort of. It's the touchscreen behavior. If I use the touchpad on the Surface to click on the elements, everything works as expected. But this touchscreen problem doesn't occur on the iPhone or iPad. Not sure what's going on with that.
EDIT 4 - Reproduced it on another Windows 8.1 laptop that has touch. So this is a Windows 8.1 only problem it seems, specific to Chrome and Firefox within that, and only when you touchscreen the buttons. Odd..