Api: Fix Et2LinkSearch initialization with value failed, giving blank widget

This commit is contained in:
nathan 2023-07-25 08:48:10 -06:00
parent a3ce1d4cab
commit 69455d725a

View File

@ -52,7 +52,7 @@ export class Et2LinkSearch extends Et2Select
get _appNode() : Et2LinkAppSelect
{
return this.parentNode.querySelector("et2-link-apps");
return this.parentNode?.querySelector("et2-link-apps");
}
/**
@ -64,7 +64,7 @@ export class Et2LinkSearch extends Et2Select
protected remoteQuery(search : string, options : object)
{
let request = this.egw().request(this.searchUrl, [this._appNode.value, '', search, options]);
let request = this.egw().request(this.searchUrl, [this._appNode?.value ?? options.app, '', search, options]);
if(this.query && typeof this.query == "function")
{
if(!this.query(request, this))