I found a problem with chrome when trying to update the parameters of the select element when the user clicks on the specified select element. The system I'm working on mostly works according to the JSFiddle below, except that the list of options is obtained through an ajax call, but even using the object gives the same result.
What happens is that when the user clicks and displays the parameters, he displays only 1 option. Then he will fill in the list of options, but will not update the number of displayed ones.
If you use the arrow keys to move up or down, you can actually select other options. The only way I can find is to click on the selection item and click it again.
It works great in IE and Firefox.
JSFiddle can be found here: http://jsfiddle.net/Largoh/Thz55/
HTML
<select id="selector">
<option value="2" selected>Option 2</option>
</select>
Javascript
$(function() {
$("#selector").click(function() {
if($("option", this).length < 2)
GetOptions(this);
});
});
function GetOptions(select) {
var Options = [
{ id: 1, text: "Option 1"},
{ id: 2, text: "Option 2"},
{ id: 3, text: "Option 3"},
{ id: 4, text: "Option 4"},
{ id: 5, text: "Option 5"},
{ id: 6, text: "Option 6"},
{ id: 7, text: "Option 7"}
];
$('option:first', select).remove();
for(var i = 0; i < Options.length;i++)
{
var option = $("<option/>");
option.val(Options[i].id).text(Options[i].text);
$(select).append(option);
}
}
source
share