Skip to content

Commit

Permalink
Allow multiple autocomplete instances
Browse files Browse the repository at this point in the history
  • Loading branch information
andreia committed Jan 13, 2025
1 parent 5733370 commit 51fc4e6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Forms/Components/GoogleAutocomplete.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public function getChildComponents(): array
{
$components = [];

$components[] = Forms\Components\Select::make('google_autocomplete')
$components[] = Forms\Components\Select::make('google_autocomplete_'.$this->name)
->native(false)
->dehydrated(false)
->allowHtml()
Expand All @@ -69,7 +69,7 @@ public function getChildComponents(): array
->searchingMessage(__('filament-google-autocomplete-field::filament-google-autocomplete-field.autocomplete.searching.message'))
->searchPrompt(__('filament-google-autocomplete-field::filament-google-autocomplete-field.autocomplete.search.prompt'))
->searchable()
->hint(new HtmlString(Blade::render('<x-filament::loading-indicator class="h5 w-5" wire:loading wire:target="data.google_autocomplete" />')))
->hint(new HtmlString(Blade::render('<x-filament::loading-indicator class="h5 w-5" wire:loading wire:target="data.google_autocomplete_'.$this->name.'" />')))
->columnSpan($this->getAutocompleteFieldColumnSpan())
->getSearchResultsUsing(function (string $search): array {
$response = $this->getPlaceAutocomplete($search);
Expand Down

0 comments on commit 51fc4e6

Please sign in to comment.