When using the Select component with multiple() options, a large number of requests are being sent.
I have implemented the component to allow selecting a department and then multiple related categories.
The component has been implemented as follows:
With this implementation, a large number of requests are being sent.
If you remove
multiple()
or avoid using a callback with options()
, you won't experience the issue of generating a large number of requests.
ā» translated by chatGPT šSolution:Jump to solution
```php
Components\FileUpload::make('image')->label('Image')->image()->required()
->disk(config('filesystems.default'))
->directory(config('filesystems.disks.'.config('filesystems.default').'.root'))
->afterStateHydrated(static function (\Filament\Forms\Components\BaseFileUpload $component, string | array | null $state): void {...
4 Replies
Even with the above implementation, multiple requests are still occurring š¢
So do you have widgets on that page?
No, widgets are not used on this page.
I found a few causes.
The following components seem to be affected
When I remove afterStateHydrated(), the requests stop.
Solution
Self resolved.
It seems that
afterStateHydrated()
was not implemented well.
I fixed it with reference to the original implementation.
thanks.