mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-07 16:44:20 +01:00
Fix Et2LinkEntry did not always show initial value
If link title was not already in cache, it might get left at ??. It was not using passed title, and sometimes was not getting title from server fast enough.
This commit is contained in:
parent
2b85b0b920
commit
d5055b9b95
@ -85,6 +85,10 @@ export class Et2LinkEntry extends Et2InputWidget(FormControlMixin(ValidateMixin(
|
||||
const select = <Et2LinkSearch><unknown>document.createElement("et2-link-search");
|
||||
if(typeof this._value !== "undefined")
|
||||
{
|
||||
if(this._value.title)
|
||||
{
|
||||
select.select_options = [{value: this._value.id, label: this._value.title}]
|
||||
}
|
||||
select.app = this._value.app;
|
||||
select.value = this._value.id;
|
||||
}
|
||||
|
@ -103,8 +103,13 @@ export class Et2LinkSearch extends Et2Select
|
||||
{
|
||||
option.label = title;
|
||||
option.class = "";
|
||||
// It's probably already been rendered
|
||||
this.requestUpdate();
|
||||
// It's probably already been rendered, find the item
|
||||
let item = this.getItems().find(i => i.value === option.value);
|
||||
if(item)
|
||||
{
|
||||
item.textContent = title;
|
||||
item.classList.remove("loading");
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user