Skip to content

Commit 6bdcea9

Browse files
Reset autocomplete field when performing a new search
1 parent fc8f80d commit 6bdcea9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Forms/Components/GoogleAutocomplete.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ public function getChildComponents(): array
7979
->searchable()
8080
->hint(new HtmlString(Blade::render('<x-filament::loading-indicator class="h5 w-5" wire:loading wire:target="data.google_autocomplete_'.$this->getAutocompleteName().'" />')))
8181
->columnSpan($this->getAutocompleteFieldColumnSpan())
82-
->getSearchResultsUsing(function (string $search): array {
82+
->getSearchResultsUsing(function (string $search, Set $set): array {
83+
$set($this->getAutocompleteName(), null);
8384
$response = $this->getPlaceAutocomplete($search);
8485

8586
$result = $response->collect();

0 commit comments

Comments
 (0)