pjsikora / select-box

Automatically exported from code.google.com/p/select-box
1 stars 0 forks source link

Updating dropdown list content on changes in native select #17

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Create an empty select element;
2. Apply selectbox() on it;
3. Change the option's content of the native select element.

What is the expected output? What do you see instead?
The applied selectbox dropdown list values is changed too.

What version of the product are you using? On what operating system?
0.2, Linux, FF 21.0

Please provide any additional information below.
This issue can be checked with the following code:
jQuery('select').selectbox({
    onChange: function(v,i) {
        var value = jQuery("select option:first").val();
        alert('value = ' + value);
        jQuery("select option:first").attr('value', value + " aa");
    }
});
On each change event the value of teh first element is updated. It can be 
checked if firebug. But the target selectbox dropdown list contains the old 
values.
Alse it is possible that some native select element can be updated 
asynchronously. 

Probably the solution is to use the jquery tie plugin 
(https://github.com/revsystems/jQuery-Tie) if it is provided? 

Original issue reported on code.google.com by AliasVec...@gmail.com on 10 Sep 2013 at 1:35