Updated search bar
@@ -23,9 +23,13 @@
|
|||||||
suggestionsForSearch = (await getSearchSuggestions(event.target.value)).suggestions;
|
suggestionsForSearch = (await getSearchSuggestions(event.target.value)).suggestions;
|
||||||
}, 250);
|
}, 250);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
function handleSubmit() {
|
||||||
|
goto(`/search/${encodeURIComponent(search)}`);
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<form on:submit|preventDefault={() => goto(`/search/${encodeURIComponent(search)}`)}>
|
<form on:submit|preventDefault={handleSubmit}>
|
||||||
<div class="field prefix round fill no-margin search">
|
<div class="field prefix round fill no-margin search">
|
||||||
<i class="front">search</i>
|
<i class="front">search</i>
|
||||||
<input bind:value={search} on:click={() => document.getElementById('search')?.focus()} />
|
<input bind:value={search} on:click={() => document.getElementById('search')?.focus()} />
|
||||||
@@ -36,8 +40,15 @@
|
|||||||
placeholder={$_('searchPlaceholder')}
|
placeholder={$_('searchPlaceholder')}
|
||||||
type="text"
|
type="text"
|
||||||
id="search"
|
id="search"
|
||||||
|
required
|
||||||
bind:value={search}
|
bind:value={search}
|
||||||
on:keyup={(target) => debouncedSearch(target)}
|
on:keyup={(event) => {
|
||||||
|
if (event.key === 'Enter') {
|
||||||
|
handleSubmit();
|
||||||
|
} else {
|
||||||
|
debouncedSearch(event);
|
||||||
|
}
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
<i class="front" on:click={() => (search = '')}>close</i>
|
<i class="front" on:click={() => (search = '')}>close</i>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -69,7 +69,7 @@
|
|||||||
</p>
|
</p>
|
||||||
<div class="divider" style="margin-bottom: 1em;"></div>
|
<div class="divider" style="margin-bottom: 1em;"></div>
|
||||||
|
|
||||||
<article class="medium scroll no-padding no-elevate no-round">
|
<article style="max-height: 200px;" class="scroll no-padding no-elevate no-round">
|
||||||
<p style="white-space: pre-line;word-wrap: break-word;">{data.playlist.description}</p>
|
<p style="white-space: pre-line;word-wrap: break-word;">{data.playlist.description}</p>
|
||||||
</article>
|
</article>
|
||||||
</article>
|
</article>
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 1.7 MiB After Width: | Height: | Size: 1.7 MiB |
|
Before Width: | Height: | Size: 1.2 MiB After Width: | Height: | Size: 684 KiB |
|
Before Width: | Height: | Size: 1.6 MiB After Width: | Height: | Size: 7.1 MiB |
|
Before Width: | Height: | Size: 1.5 MiB After Width: | Height: | Size: 1.5 MiB |
|
Before Width: | Height: | Size: 1.6 MiB After Width: | Height: | Size: 706 KiB |
|
Before Width: | Height: | Size: 1.8 MiB After Width: | Height: | Size: 1.5 MiB |
|
Before Width: | Height: | Size: 1.4 MiB After Width: | Height: | Size: 1.3 MiB |