fix instead of all only last option was selected sometimes

because multiple property was not yet synced to DOM node
This commit is contained in:
ralf 2022-03-15 11:43:55 +02:00
parent e5a6f195dc
commit 7a749a8f54

View File

@ -174,6 +174,7 @@ export class Et2Select extends Et2InvokerMixin(Et2WidgetWithSelect)
} }
else else
{ {
this._inputNode.multiple = true; // in case property is not yet set, selectbox will unselect all other options
this._inputNode.querySelectorAll('option').forEach((el : HTMLOptionElement) => this._inputNode.querySelectorAll('option').forEach((el : HTMLOptionElement) =>
{ {
el.selected = [].concat(value).find(val => val == el.value); el.selected = [].concat(value).find(val => val == el.value);