Skip to content

Commit

Permalink
Merge pull request #334 from hearchco/as/fix/suggestions
Browse files Browse the repository at this point in the history
fix: suggestions
  • Loading branch information
aleksasiriski authored Jun 29, 2024
2 parents 5354380 + d08f73b commit 9e5c96c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/lib/components/results/images/single.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
class:hover:dark:ring-hearchco-secondary={selected}
class:hover:ring-neutral-300={!selected}
class:hover:dark:ring-neutral-100={!selected}
class="size-full rounded-lg shadow-sm dark:shadow-none overflow-hidden hover:ring-4 hover:scale-110 relative z-0 hover:z-50 transform delay-75 duration-300 ease-in-out"
class="size-full rounded-lg shadow-sm dark:shadow-none overflow-hidden hover:ring-4 hover:scale-110 relative z-0 hover:z-10 transform delay-75 duration-300 ease-in-out"
onclick={openImage}
>
<img
Expand Down
6 changes: 3 additions & 3 deletions src/lib/components/searchbox/main.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@
/** @type {Promise<SuggestionType[]>} */
let suggestions = $derived.by(async () => {
if (query === '') {
if (query === '' || getQueryWithoutCategory(query) === '') {
enoughSuggs = false;
return [];
} else {
enoughSuggs = false;
const suggs = await fetchSuggestions(query);
const suggs = await fetchSuggestions(getQueryWithoutCategory(query));
if (suggs.length > 10) suggs.splice(10, suggs.length - 10);
if (suggs.length > 0) enoughSuggs = true;
return suggs;
Expand Down Expand Up @@ -194,7 +194,7 @@
{#if showSuggestions}
<ul
onmouseleave={() => (currentIndex = -1)}
class="w-full rounded-b-lg bg-white dark:bg-neutral-800 border border-neutral-200 dark:border-0"
class="z-50 w-full rounded-b-lg bg-white dark:bg-neutral-800 border border-neutral-200 dark:border-0"
>
{#each suggestions as suggestion, i}
<li
Expand Down

0 comments on commit 9e5c96c

Please sign in to comment.