[V3] Removing upload from FileUpload does not trigger `afterStateUpdated`

Hiya!

Testing our project on V3 and found this bug(?) or at least unexpected behaviour.

I have this FileUpload field in a form with multiple files allowed. Whenever you upload a file I need to execute some code, which I do using
afterStateUpdated
. This works perfectly fine for adding files, but it's not called when you remove a file.

FileUpload::make('uploads')
    ->multiple()
    ->storeFiles(false)
    ->afterStateUpdated(function (array $state, Get $get, Set $set) {
        collect($state)->map(fn (TemporaryUploadedFile $file, $key) => do_something());
    }),
Was this page helpful?