From a59bf96fc37f7f59560c70f22c8663c4e93121f0 Mon Sep 17 00:00:00 2001 From: Cyrille Bourgois Date: Wed, 3 Apr 2019 14:43:44 +0200 Subject: [PATCH] fix(oui-select-picker): update when model changes (#378) --- packages/oui-select-picker/src/select-picker.controller.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/oui-select-picker/src/select-picker.controller.js b/packages/oui-select-picker/src/select-picker.controller.js index 24096615..803a495a 100644 --- a/packages/oui-select-picker/src/select-picker.controller.js +++ b/packages/oui-select-picker/src/select-picker.controller.js @@ -38,6 +38,12 @@ export default class SelectPickerController { } } + this.$scope.$watch(() => this.model, (newValue) => { + if (this.model && find(this.values, newValue)) { + this.selectedValue = newValue; + } + }); + this.sectionTransclude = this.$transclude.isSlotFilled("sectionSlot"); this.deprecatedTransclude = this.$transclude.isSlotFilled("deprecatedSlot"); }