diff --git a/app/Livewire/GlobalSearch.php b/app/Livewire/GlobalSearch.php index e8dfd39..10fc1d7 100644 --- a/app/Livewire/GlobalSearch.php +++ b/app/Livewire/GlobalSearch.php @@ -51,8 +51,7 @@ class GlobalSearch extends Component $results['total'] = $this->countTotalResults($results['data']); } - $this->showDropdown = Str::length($query) > 0; - $this->noResults = $results['total'] === 0 && $this->showDropdown; + $this->noResults = $results['total'] === 0; return $results; } @@ -94,14 +93,4 @@ class GlobalSearch extends Component return $carry + $result->count(); }, 0); } - - /** - * Clear the search query and hide the dropdown. - */ - public function clearSearch(): void - { - $this->query = ''; - $this->showDropdown = false; - $this->noResults = false; - } } diff --git a/resources/views/components/global-search-results.blade.php b/resources/views/components/global-search-results.blade.php index 4f6cc65..12f08b3 100644 --- a/resources/views/components/global-search-results.blade.php +++ b/resources/views/components/global-search-results.blade.php @@ -1,5 +1,11 @@ -