Et2Email: If searchUrl is set to "", skip server search / suggestions

This commit is contained in:
nathan 2023-12-19 13:55:02 -07:00 committed by ralf
parent 469c0cf742
commit 477af60705

View File

@ -141,7 +141,18 @@ export class Et2Email extends Et2InputWidget(LitElement) implements SearchMixinI
*/ */
@property({type: Boolean, reflect: true}) open = false; @property({type: Boolean, reflect: true}) open = false;
/**
* Custom search options, passed to the searchUrl along with the search text
*
* @type {{includeLists : boolean}}
*/
@property({type: Object}) searchOptions = {includeLists: true}; @property({type: Object}) searchOptions = {includeLists: true};
/**
* Server-side search for suggested email addresses.
* Set to "" to cancel searching.
* @type {string}
*/
@property({type: String}) searchUrl = "EGroupware\\Api\\Etemplate\\Widget\\Taglist::ajax_email"; @property({type: String}) searchUrl = "EGroupware\\Api\\Etemplate\\Widget\\Taglist::ajax_email";
@state() searching = false; @state() searching = false;
@ -451,6 +462,12 @@ export class Et2Email extends Et2InputWidget(LitElement) implements SearchMixinI
// Clear current option, it's probably going to go away // Clear current option, it's probably going to go away
this.setCurrentOption(null); this.setCurrentOption(null);
// If no searchUrl, no search
if(!this.searchUrl)
{
return;
}
this.searching = true; this.searching = true;
this.requestUpdate("searching"); this.requestUpdate("searching");