only render clear button if there is a search query

This commit is contained in:
Mads Rasmussen
2024-08-13 14:39:02 +02:00
parent cd7231fc2b
commit 3face07715

View File

@@ -213,11 +213,13 @@ export class UmbTreePickerModalElement<TreeItemType extends UmbTreeItemModelBase
: html`<uui-icon name="search"></uui-icon>`}
</div>
<div slot="append">
<uui-button type="button" @click=${this.#onSearchClear} compact>
<uui-icon name="icon-delete"></uui-icon>
</uui-button>
</div>
${this._searchQuery
? html`
<uui-button slot="append" type="button" @click=${this.#onSearchClear} compact>
<uui-icon name="icon-delete" @click=${this.#onSearchClear}></uui-icon>
</uui-button>
`
: nothing}
</uui-input>
<div id="search-divider"></div>
${this.#renderSearchResult()}