diff --git a/packages/main/src/Select.ts b/packages/main/src/Select.ts index 2c760c8158b0..defd6fd54eaa 100644 --- a/packages/main/src/Select.ts +++ b/packages/main/src/Select.ts @@ -467,6 +467,8 @@ class Select extends UI5Element implements IFormElement { this._onMenuChange = this.onMenuChange.bind(this); this._attachMenuListeners = this.attachMenuListeners.bind(this); this._detachMenuListeners = this.detachMenuListeners.bind(this); + + this._upgradeProperty("value"); } onBeforeRendering() { @@ -540,8 +542,11 @@ class Select extends UI5Element implements IFormElement { * @formEvents change liveChange */ set value(newValue: string) { - this.selectOptions.forEach(option => { - option.selected = !!((option.value || option.textContent) === newValue); + const menu = this._getSelectMenu(); + const selectOptions = Array.from(menu ? menu.children : this.children).filter(option => !option.getAttribute("disabled")) as Array; + + selectOptions.forEach(option => { + option.selected = !!((option.getAttribute("value") || option.textContent) === newValue); }); }