diff --git a/api/js/etemplate/Et2Link/Et2LinkEntry.ts b/api/js/etemplate/Et2Link/Et2LinkEntry.ts index 5866164338..a9bc984538 100644 --- a/api/js/etemplate/Et2Link/Et2LinkEntry.ts +++ b/api/js/etemplate/Et2Link/Et2LinkEntry.ts @@ -284,7 +284,7 @@ export class Et2LinkEntry extends Et2InputWidget(FormControlMixin(SlotMixin(LitE protected _handleEntrySelect(event) { event.stopPropagation(); - this.classList.add("hideApp"); + this.classList.toggle("hideApp", Boolean(typeof this.value == "object" ? this.value?.id : this.value)); this.dispatchEvent(new Event("change")); this.requestUpdate('value'); @@ -390,10 +390,7 @@ export class Et2LinkEntry extends Et2InputWidget(FormControlMixin(SlotMixin(LitE this.app = value.app; this._searchNode.value = value.id; } - if(value.id) - { - this.classList.add("hideApp"); - } + this.classList.toggle("hideApp", Boolean(value.id)); } /** diff --git a/api/js/etemplate/Et2Link/Et2LinkString.ts b/api/js/etemplate/Et2Link/Et2LinkString.ts index ed62721cb0..29a1b3342c 100644 --- a/api/js/etemplate/Et2Link/Et2LinkString.ts +++ b/api/js/etemplate/Et2Link/Et2LinkString.ts @@ -300,7 +300,17 @@ export class Et2LinkString extends Et2Widget(LitElement) implements et2_IDetache this._loadingPromise = >(this.egw().jsonq('EGroupware\\Api\\Etemplate\\Widget\\Link::ajax_link_list', [_value])) .then(_value => { - this._addLinks(not_saved_links.concat(_value)); + if(_value && Array.isArray(_value)) + { + for(let link of _value) + { + if(!not_saved_links.some(l => l.app == link.app && l.id == link.id)) + { + not_saved_links.push(link); + } + } + } + this._addLinks(not_saved_links); this._loadingPromise = null; }) }