You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In a form with a select with two options and two dependent fields: a fileupload and a richeditor. Using requiredIf(), when the selected option is "1" the fileupload field is required, and when the selected option is "2" the richeditor is required.
The problem is that the fileupload is not required correctly, and you can create a record with type "1" without uploading anything. When selecting type "2" the richeditor is required so you can't create a record with type "2" and no text.
The fileupload is always required if you use ->required(), so I think this is a problem just with the conjuntion fileupload + requiredIf().
Expected behavior
You shouldn't be able to submit the form if you choose "1" in the select and don't upload the file, and the error message "The file field is required when type is 1" should appear.
Package
filament/filament
Package Version
v3.3.3
Laravel Version
v12.1.1
Livewire Version
v3.6.1
PHP Version
PHP 8.4.5
Problem description
In a form with a select with two options and two dependent fields: a fileupload and a richeditor. Using requiredIf(), when the selected option is "1" the fileupload field is required, and when the selected option is "2" the richeditor is required.
The problem is that the fileupload is not required correctly, and you can create a record with type "1" without uploading anything. When selecting type "2" the richeditor is required so you can't create a record with type "2" and no text.
The fileupload is always required if you use ->required(), so I think this is a problem just with the conjuntion fileupload + requiredIf().
Expected behavior
You shouldn't be able to submit the form if you choose "1" in the select and don't upload the file, and the error message "The file field is required when type is 1" should appear.
Steps to reproduce
Reproduction repository (issue will be closed if this is not valid)
https://github.com/mariavilaro/filament-issue-requiredif-fileupload
Relevant log output
The text was updated successfully, but these errors were encountered: