Bug in select/optgroup using keyboard accelerators in webkit?

342 Views Asked by At

See http://jsfiddle.net/3EksU/2/

With Safari and Chrome in the example, if you select (without opening the drop down) and I press a letter key on the keyboard, the value in the select box if rotating among the value that begin with that letter AS EXPECTED.

However if the select drop down is open, pressing any key on the first drop down bring me always to Zurich and on the second it brings me on "Zoo"

No problems in Firefox. It works as expected

It seems to be a bug. Or am I doing something wrong in the HTML?

2

There are 2 best solutions below

0
On
0
On

Work around in jQuery:

if($.browser.webkit)
$(...).find('optgroup').each(function() {
  var optgrp = $(this);
  optgrp.parent().append('<option disabled="disabled">' + optgrp.attr('label') + '</option>' + optgrp.html()); 
  optgrp.remove();
});