mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-12 08:58:30 +01:00
Et2Select: Fix email (& other values with spaces) did not show initial value
This commit is contained in:
parent
5cac07e124
commit
4159e2493c
@ -421,7 +421,7 @@ export class Et2Select extends Et2WithSearchMixin(Et2WidgetWithSelect)
|
||||
}
|
||||
if(this.select)
|
||||
{
|
||||
this.select.value = this.__value;
|
||||
this.select.value = this.shoelaceValue;
|
||||
}
|
||||
this.requestUpdate("value", oldValue);
|
||||
}
|
||||
@ -511,19 +511,6 @@ export class Et2Select extends Et2WithSearchMixin(Et2WidgetWithSelect)
|
||||
}
|
||||
}
|
||||
|
||||
update(changedProperties : PropertyValues)
|
||||
{
|
||||
super.update(changedProperties);
|
||||
if(changedProperties.has("select_options") && changedProperties.has("value"))
|
||||
{
|
||||
// Force select to stay in sync, avoids value not shown when select options arrive late
|
||||
if(this.select && this.value !== null && typeof this.value !== "undefined")
|
||||
{
|
||||
this.select.value = this.value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Tag used for rendering tags when multiple=true
|
||||
* Used for creating, finding & filtering options.
|
||||
@ -804,7 +791,13 @@ export class Et2Select extends Et2WithSearchMixin(Et2WidgetWithSelect)
|
||||
return typeof super._extraTemplate == "function" ? super._extraTemplate() : nothing;
|
||||
}
|
||||
|
||||
public render()
|
||||
/**
|
||||
* Shoelace select uses space as multiple separator, so our values cannot have a space in them.
|
||||
* We replace spaces with "___" before passing the value to SlSelect
|
||||
*
|
||||
* @protected
|
||||
*/
|
||||
protected get shoelaceValue() : string | string[]
|
||||
{
|
||||
return Array.isArray(this.value) ?
|
||||
this.value.map(v => { return v.replaceAll(" ", "___"); }) :
|
||||
|
Loading…
Reference in New Issue
Block a user