Skip to content

Commit af10fa3

Browse files
committed
fix
1 parent 476c9ed commit af10fa3

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/Forms/Components/SearchableInput.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ protected function setUp(): void
2424
$this->extraInputAttributes(['x-model' => 'value']);
2525

2626
$this->registerActions([
27-
Action::make('search')->action(function (SearchableInput $component, array $arguments): array {
27+
Action::make('search')->action(function(SearchableInput $component, array $arguments): array {
2828
if ($component->isDisabled() || $component->isReadOnly()) {
2929
return [];
3030
}
@@ -37,21 +37,21 @@ protected function setUp(): void
3737
]);
3838

3939
$results ??= collect($this->getOptions())
40-
->filter(fn (string $option) => str($option)->contains($search))
40+
->filter(fn(string $option) => str($option)->contains($search))
4141
->toArray();
4242

43-
if (collect($results)->every(fn ($item) => is_string($item))) {
43+
if (collect($results)->every(fn($item) => is_string($item))) {
4444
$results = collect($results)
45-
->map(fn ($item, $key) => [
45+
->map(fn($item, $key) => [
4646
'value' => $key,
4747
'label' => $item,
4848
]);
4949
}
5050

51-
return $results;
51+
return $results->toArray();
5252
}),
5353

54-
Action::make('item_selected')->action(function ($arguments) {
54+
Action::make('item_selected')->action(function($arguments) {
5555
$this->evaluate($this->onItemSelected, [
5656
'item' => $arguments['item'],
5757
]);

0 commit comments

Comments
 (0)