#8 Bad behaviour with mouse and dropdown list in FF4 & Chrome 1

open
nobody
None
5
2012-11-20
2011-05-09
Iñigo Martinez
No

When pointing with mouse over a searchable dropdown list, mouse placement does not fit with selection bar. This happen specially with new browsers like Firefox 4 and Chrome 10.

Our fix:

q.mousemove(function(e) {
if ($.browser.opera && parseFloat(jQuery.browser.version) >= 9.8)
return true;
var a = Math.floor(parseFloat(/([0-9\.]+)px/.exec(u.option(0).css(
"font-size"))));
var b = 2;
if ($.browser.mozilla && parseInt(jQuery.browser.version) < 2)
b = 3;
if ($.browser.opera)
b = 2.5;
if ($.browser.safari || $.browser.chrome)
b = 2.5;
a += Math.round(a / b);
a++;
u.selectedIndex(Math
.floor((e.pageY - q.offset().top + this.scrollTop) / a));
});

Discussion