diff --git a/api/js/etemplate/Et2Select/SearchMixin.ts b/api/js/etemplate/Et2Select/SearchMixin.ts index 52343707e0..7654f786c3 100644 --- a/api/js/etemplate/Et2Select/SearchMixin.ts +++ b/api/js/etemplate/Et2Select/SearchMixin.ts @@ -7,7 +7,7 @@ * @author Nathan Gray */ -import {css, CSSResultGroup, html, LitElement, nothing, render, TemplateResult} from "lit"; +import {css, CSSResultGroup, html, LitElement, nothing, TemplateResult} from "lit"; import {cleanSelectOptions, SelectOption} from "./FindSelectOptions"; import {Validator} from "@lion/form-core"; import {Et2Tag} from "./Tag/Et2Tag"; @@ -419,6 +419,7 @@ export const Et2WithSearchMixin = dedupeMixin( return html` ${this._searchInputTemplate()} ${this._moreResultsTemplate()} + ${this._noResultsTemplate()} `; } @@ -463,6 +464,11 @@ export const Et2WithSearchMixin = dedupeMixin( protected _noResultsTemplate() { + if(this._total_result_count !== 0) + { + return nothing; + } + return html`
${this.egw().lang("no suggestions")}
`; } @@ -1037,15 +1043,6 @@ export const Et2WithSearchMixin = dedupeMixin( this.remoteSearch(this._searchInputNode.value, this.searchOptions) ]).then(() => { - // Show no results indicator - if(this.getAllOptions().filter(e => !e.classList.contains("no-match")).length == 0) - { - let target = this._optionTargetNode || this; - let temp = document.createElement("div"); - render(this._noResultsTemplate(), temp); - target.append(temp.children[0]); - } - // Remove spinner spinner.remove();