Skip to content

Commit

Permalink
Clear search input when user clicks navbar logo (#539)
Browse files Browse the repository at this point in the history
* Clear search input when user clicks navbar logo

* Reset filter state
  • Loading branch information
thinkstpaul authored Jul 23, 2024
1 parent 89207a8 commit 886df6b
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions frontend_vue/src/components/SearchFilterTokensHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
>
<ul class="flex flex-row flex-wrap gap-8 list-none justify-left">
<FilterButton
id="filterAll"
category="All"
:selected="!filterValue"
@click="filterValue = ''"
Expand Down
4 changes: 2 additions & 2 deletions frontend_vue/src/components/base/BaseSwitch.vue
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ function handleToggle(event: Event) {
input[type='checkbox'].toggle {
opacity: 0;
position: absolute;
left: -9000px;
top: -9000px;
left: 0px;
top: 0px;
}

label {
Expand Down
2 changes: 2 additions & 0 deletions frontend_vue/src/components/ui/AppLogo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,7 @@ const router = useRouter();
function handleLinkClick(path: string) {
//@ts-ignore
addViewTransition(() => router.push(path));
document.getElementById('filterAll')?.click();
document.getElementById('clearSearchInput')?.click();
}
</script>
1 change: 1 addition & 0 deletions frontend_vue/src/components/ui/SearchBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
v-if="value && value.length > 0"
class="absolute top-[.25rem] right-16 text-grey-300 duration-150 cursor-pointer hover:text-green-500"
@click="clearInput"
id="clearSearchInput"
>
<font-awesome-icon
icon="close"
Expand Down

0 comments on commit 886df6b

Please sign in to comment.