Skip to content

Commit af895be

Browse files
committed
fix: ProductSearchBox.vue
1 parent 1a3e756 commit af895be

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

components/ProductSearchBox.vue

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
class="group flex h-10 flex-grow rounded-xl border border-transparent bg-neutral-800/5 dark:bg-white/10 pl-4 pr-3 transition-all focus-within:border-neutral-400 focus-within:dark:border-neutral-600 focus-within:bg-white/30 focus-within:dark:bg-neutral-800/30 hover:border-neutral-300 hover:focus-within:border-neutral-400 hover:dark:border-neutral-600">
55
<div class="flex w-full items-center gap-4">
66
<div class="flex text-neutral-500 dark:text-neutral-400">
7-
<Icon name="majesticons:search-line" size="20"></Icon>
7+
<Icon name="majesticons:search-line" size="20" />
88
</div>
99
<div class="flex w-full">
1010
<input
@@ -13,9 +13,9 @@
1313
@input="updateSearchTerm"
1414
:placeholder="selectedCategory ? `Search in ${selectedCategory}` : 'Search'" />
1515
</div>
16-
<div @click="clearSearchTerm" class="opacity-0 flex cursor-pointer text-neutral-300 dark:text-neutral-500 transition-all group-focus-within:opacity-100">
16+
<div v-if="searchTerm" @click="clearSearchTerm" class="flex cursor-pointer text-neutral-300 dark:text-neutral-500 transition-all">
1717
<Icon v-if="!loading" name="solar:close-square-bold" size="24" />
18-
<Icon v-else-if="loading" name="Loading" size="20" />
18+
<Icon v-else name="Loading" size="20" />
1919
</div>
2020
</div>
2121
</form>
@@ -31,8 +31,8 @@ defineProps({
3131
3232
const emits = defineEmits(['update:searchTerm']);
3333
34-
const updateSearchTerm = (event) => {
35-
emits('update:searchTerm', event.target.value);
34+
const updateSearchTerm = ({ target: { value } }) => {
35+
emits('update:searchTerm', value);
3636
};
3737
3838
const clearSearchTerm = () => {

0 commit comments

Comments
 (0)