Closed jonobobo closed 10 years ago
Here's a jsfiddle: http://jsfiddle.net/HPwGC/
Note the first call to update the selectbox works correctly in Minimalect, but subsequent calls are ignored, despite calling .change()
Ok this can be circumvented by using .val() before .change(), although I still feel it's a little awkward. Changing the options within a selectbox should automatically render to Minimalect.
Working code to dynamically add options to the selectbox:
$("#myselect").append('<option value="foo">bar</option>').val("foo").change();
Just using val() without the value parameter also works.
Just a heads up; 5bb4226 adds much better dynamic change detection via MutationObserver (polyfill or public method callback required for IE and older others) -- might wanna check it out!
Ah great stuff. Thanks for all your hard work
^^ Successfully adds an
Subsequent calls (with different option value/text pairs) just don't work. IE, the option just doesn't append in Minimalect.
What's the recommended procedure for adding/removing/updating options in a select that's being bound to Minimalect, or is this just a bug?