hide suggestion section when no suggestions exist
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -70,10 +70,10 @@ export function SearchModal<T>(
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div
|
||||||
|
toggle:hidden={searchViewModel.hasNoSuggestions}>
|
||||||
<hr></hr>
|
<hr></hr>
|
||||||
|
|
||||||
<h3>{coreViewModel.translations.general.searchSuggestionsLabel}</h3>
|
<h3>{coreViewModel.translations.general.searchSuggestionsLabel}</h3>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
class="flex-column gap"
|
class="flex-column gap"
|
||||||
children:append={[
|
children:append={[
|
||||||
@@ -81,6 +81,7 @@ export function SearchModal<T>(
|
|||||||
(suggestion: string) => SuggestionView(suggestion, searchViewModel, coreViewModel),
|
(suggestion: string) => SuggestionView(suggestion, searchViewModel, coreViewModel),
|
||||||
]}
|
]}
|
||||||
></div>
|
></div>
|
||||||
|
</div>
|
||||||
</main>
|
</main>
|
||||||
<button on:click={close}>
|
<button on:click={close}>
|
||||||
{coreViewModel.translations.general.closeButton}
|
{coreViewModel.translations.general.closeButton}
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -15,6 +15,7 @@ export default class SearchViewModel<T> {
|
|||||||
[this.searchInput],
|
[this.searchInput],
|
||||||
() => this.searchInput.value == "",
|
() => this.searchInput.value == "",
|
||||||
);
|
);
|
||||||
|
hasNoSuggestions: React.State<boolean> = React.createProxyState([this.suggestions], ()=>this.suggestions.value.size == 0);
|
||||||
|
|
||||||
// methods
|
// methods
|
||||||
search = (searchTerm: string): void => {
|
search = (searchTerm: string): void => {
|
||||||
|
|||||||
Reference in New Issue
Block a user