hide suggestion section when no suggestions exist

This commit is contained in:
marlon-erler
2026-09-21 21:31:22 +02:00
parent deaa784148
commit 241f9e137d
7 changed files with 21 additions and 19 deletions
Binary file not shown.
Binary file not shown.
+19 -18
View File
@@ -70,24 +70,25 @@ export function SearchModal<T>(
</button>
</div>
<hr></hr>
<h3>{coreViewModel.translations.general.searchSuggestionsLabel}</h3>
<div
class="flex-column gap"
children:append={[
searchViewModel.suggestions,
(suggestion: string) => SuggestionView(suggestion, searchViewModel, coreViewModel),
]}
></div>
</main>
<button on:click={close}>
{coreViewModel.translations.general.closeButton}
<span class="icon">close</span>
</button>
</div>
</div>
<div
toggle:hidden={searchViewModel.hasNoSuggestions}>
<hr></hr>
<h3>{coreViewModel.translations.general.searchSuggestionsLabel}</h3>
<div
class="flex-column gap"
children:append={[
searchViewModel.suggestions,
(suggestion: string) => SuggestionView(suggestion, searchViewModel, coreViewModel),
]}
></div>
</div>
</main>
<button on:click={close}>
{coreViewModel.translations.general.closeButton}
<span class="icon">close</span>
</button>
</div>
</div>
);
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
+1
View File
@@ -15,6 +15,7 @@ export default class SearchViewModel<T> {
[this.searchInput],
() => this.searchInput.value == "",
);
hasNoSuggestions: React.State<boolean> = React.createProxyState([this.suggestions], ()=>this.suggestions.value.size == 0);
// methods
search = (searchTerm: string): void => {