multiselect creates groups after selecting first item

I'm using the table builder in a Livewire component.
I have a multi select that searches using a custom function.
On the first search it works fine (picture 1),
but after i select a record, all of a sudden all my options are in groups. (picture 2)

This is my select field:
Select::make('city')
                    ->live()
                    ->multiple()
                    ->getSearchResultsUsing(function (string $search) {
                        return $this->updatedCitySearch($search);
                    })
                    ->getOptionLabelUsing(fn ($value): ?string => $value),


My custom search returns an array like this:
[
   ['Schoonhoven' => 'Schoonhoven'],
   ['Schoonloo' => 'Schoonloo'],
   ...  
]


How do i prevent my records from going in to groups?
image.png
image.png
Was this page helpful?