Does anyone know how to prevent the page from switching to input when it has changed? In particular, if it has changed using the shortcut button from another place on the page.
This issue affects IE, Chrome Canary, FireFox, and possibly some others, in fact the only browser that it does not seem to be affected is Chrome v28.
Here you can see the problem: http://jsfiddle.net/FgaWM/3/
This will usually be a useful feature, but in my case it is quite annoying, I need a way to prevent / override it.
I tried to force the scroll position using jQuery:
var labelPos = $(window).scrollTop(); $(window).scrollTop(labelPos);
This solution ... is at best buggy, causing an instant page flicker.
Does anyone have a better way?
Edit: I understood the solution: P
$('label').click(function(e) { e.preventDefault(); var For = $(this).attr('for'); $('#' + For).trigger('click'); });
source share