mirror of
https://github.com/rstudio/shiny.git
synced 2026-04-07 03:00:20 -04:00
Merge pull request #414 from jcheng5/bugfix/selectize-order
Fix selectize misordering on updateSelectInput
This commit is contained in:
@@ -1998,6 +1998,13 @@
|
||||
if (selectize) {
|
||||
selectize = selectize[0].selectize;
|
||||
selectize.clearOptions();
|
||||
// Selectize.js doesn't maintain insertion order on Chrome on Mac
|
||||
// with >10 items if inserted using addOption (versus being present
|
||||
// in the DOM at selectize() time). Putting $order on each option
|
||||
// makes it work.
|
||||
$.each(data.options, function(i, opt) {
|
||||
opt.$order = i;
|
||||
});
|
||||
selectize.addOption(data.options);
|
||||
}
|
||||
for (var i = 0; i < data.options.length; i++) {
|
||||
|
||||
Reference in New Issue
Block a user