File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ protected function setUp(): void
24
24
$ this ->extraInputAttributes (['x-model ' => 'value ' ]);
25
25
26
26
$ this ->registerActions ([
27
- Action::make ('search ' )->action (function (SearchableInput $ component , array $ arguments ): array {
27
+ Action::make ('search ' )->action (function (SearchableInput $ component , array $ arguments ): array {
28
28
if ($ component ->isDisabled () || $ component ->isReadOnly ()) {
29
29
return [];
30
30
}
@@ -37,21 +37,23 @@ protected function setUp(): void
37
37
]);
38
38
39
39
$ results ??= collect ($ this ->getOptions ())
40
- ->filter (fn (string $ option ) => str ($ option )->contains ($ search ))
40
+ ->filter (fn (string $ option ) => str ($ option )->contains ($ search ))
41
41
->toArray ();
42
42
43
- if (collect ($ results )->every (fn ($ item ) => is_string ($ item ))) {
43
+
44
+
45
+ if (collect ($ results )->every (fn ($ item ) => is_string ($ item ))) {
44
46
$ results = collect ($ results )
45
- ->map (fn ($ item , $ key ) => [
47
+ ->map (fn ($ item , $ key ) => [
46
48
'value ' => $ key ,
47
49
'label ' => $ item ,
48
- ]);
50
+ ])-> toArray () ;
49
51
}
50
52
51
- return $ results-> toArray () ;
53
+ return $ results ;
52
54
}),
53
55
54
- Action::make ('item_selected ' )->action (function ($ arguments ) {
56
+ Action::make ('item_selected ' )->action (function ($ arguments ) {
55
57
$ this ->evaluate ($ this ->onItemSelected , [
56
58
'item ' => $ arguments ['item ' ],
57
59
]);
You can’t perform that action at this time.
0 commit comments