Fixing select2 placeholder when the data is reactive

This commit is contained in:
Bruno Alves de Faria 2017-03-30 10:56:25 -03:00
parent 807c288db0
commit 41fb606b2a

View File

@ -19,6 +19,7 @@ OHIF.mixins.select2 = new OHIF.Mixin({
// Check if this select will include a placeholder
const placeholder = instance.data.options && instance.data.options.placeholder;
if (placeholder) {
instance.autorun(() => {
// Get the option items
let items = instance.data.items;
@ -44,6 +45,7 @@ OHIF.mixins.select2 = new OHIF.Mixin({
instance.data.items = newItems;
}
}
});
}
},