Open sinnbeck opened 2 months ago
If I downgrade to v3.2.76 the issue goes away. I believe it was introduced in v3.2.83 to try and fix a bug introduced in v3.2.77
Could you please check if this issue still exists in the latest version of Filament v3.2.97), @sinnbeck?
@zepfietje Sadly it is still an issue in 3.2.97. The repo I linked was tested with that version :)
Thanks for checking, @sinnbeck!
Package
filament/forms
Package Version
v3.2.97
Laravel Version
v10.48.18
Livewire Version
No response
PHP Version
PHP 8.2
Problem description
When testing a component with a file upload component in it, the afterStateUpdated() method gets called twice. It does not, in the browser.
I ran into the issue when removing files on validation errors (scanning for virus). The second time it is then called, it replaces the file with
null
(another bug I think?), which then breaks the file validation as null isn't allowed in the array.Expected behavior
Dont call the afterStateUpdated() twice
Steps to reproduce
Use the file upload in a form with
afterStateUpdated()
and have a test that fills it out.Run
vendor/bin/pest
and see that it outputs CALLED twiceReproduction repository (issue will be closed if this is not valid)
https://github.com/sinnbeck/filament-upload-test-issue
Relevant log output
No response
Donate 💰 to fund this issue