Skip to content

Google Maps autocomplete input conflict inside Repeater when editing existing records #156

@ibtissamwannas

Description

@ibtissamwannas

When using the \Filament\Forms\Components\Map field with autocomplete() inside a Repeater, the Google Maps autocomplete search field works fine during creation. However, when editing an existing record with multiple repeater items:

The first map’s search field does not respond to input.

Typing in the first search field updates the second map’s location.

The autocomplete results consistently appear only on the last initialized map input.

It appears that the Google Maps API binds autocomplete behavior to DOM elements by ID or class, and when repeaters render multiple maps with the same structure, the autocomplete instances interfere with each other.

Reproduction steps:

  1. Add a Repeater with at least two items using Map::make()->autocomplete('location').
  2. Inside the same schema, include a TextInput::make('location') as the target input.
  3. Load the form in edit mode with existing data that populates at least two repeater items.
  4. Attempt to use the autocomplete search input on the first repeater item — it does not trigger autocomplete suggestions.
  5. Type in the second item's search field — autocomplete suggestions appear, but selecting a result updates the first map instead of the second.

Expected behavior:
Each Map component inside the Repeater should have its own isolated autocomplete input and should respond independently.

Repeater::make('location section')
    ->relationship('location')
    ->minItems(2)
    ->columns(2)
    ->schema([
        TextInput::make('location')
            ->label('Search Address')
            ->placeholder('Search...')
            ->columnSpanFull()
            ->dehydrated(false),

        Map::make('map')
            ->label('Map Location')
            ->autocomplete('location')
            ->columnSpanFull()
            ->clickable(true)
            ->autocompleteReverse(true)
            ->dehydrated(false),
            

    ])

Version info: Filament: v3.x, PHP: 8.2,Laravel: 11

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions