-
Notifications
You must be signed in to change notification settings - Fork 118
Description
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:
- Add a Repeater with at least two items using Map::make()->autocomplete('location').
- Inside the same schema, include a TextInput::make('location') as the target input.
- Load the form in edit mode with existing data that populates at least two repeater items.
- Attempt to use the autocomplete search input on the first repeater item — it does not trigger autocomplete suggestions.
- 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