Skip to content

Commit 3634509

Browse files
authored
Merge pull request #32 from AlexandreCConcept/main
Reset autocomplete field when performing a new search
2 parents fc8f80d + 6bdcea9 commit 3634509

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)