mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-08 09:05:16 +01:00
Show empty_label when given a value that is not in the list of options
This commit is contained in:
parent
41a18b6274
commit
f0455b2ad2
@ -78,6 +78,10 @@ export class Et2WidgetWithSelect extends Et2InputWidget(LionSelect)
|
||||
set_value(val)
|
||||
{
|
||||
let oldValue = this.modalValue;
|
||||
|
||||
// Make sure it's a string
|
||||
val = "" + val;
|
||||
|
||||
this.modalValue = val
|
||||
this.requestUpdate("value", oldValue);
|
||||
}
|
||||
@ -229,6 +233,11 @@ export class Et2Select extends Et2WidgetWithSelect
|
||||
}
|
||||
if(changedProperties.has('select_options') || changedProperties.has("value"))
|
||||
{
|
||||
if(this.get_select_options().length > 0 && this.get_select_options().filter((option) => option.value == this.modalValue).length === 0)
|
||||
{
|
||||
// Not in list, clear it
|
||||
this.modalValue = "";
|
||||
}
|
||||
// Re-set value, the option for it may have just shown up
|
||||
this._inputNode.value = this.modalValue || "";
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user