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
The current behavior is that Filament incorrectly says the select dropdown is required. Which it is, but the first value is already selected. If you select a different value, then the first one again, it works as expected.
The expected behavior would be to get an Exception with a SQL error because I haven't included all the required fields for the default Laravel user. A full form that throws no exceptions doesn't change anything.
Reproduction repository (issue will be closed if this is not valid)
This is the behaviour of an HTML select if you do not have a blank option and do not have any options with the selected attribute. The first option is not really selected.
To fix this, you can pass ->default('test') so that an option has the selected attribute.
Package
filament/filament
Package Version
v3.2.131
Laravel Version
v11.5.0
Livewire Version
v3.5.18
PHP Version
8.3.8
Problem description
If selectablePlaceholder(false) is called and the select is NOT interacted with, then it passes null instead of the first option of the form.
IF you make that field ->required(), THEN it also says that field is necessary, even though the first value is already selected.
If you select a different dropdown value and then select the first one again, then it works as expected.
Expected behavior
null
should NEVER be passed UNLESS the first default option's value is null WHEN->selectablePlaceholder(false)
.Steps to reproduce
Add a simple Select to any form:
Go to http://application.test/admin/users/create and then click create without doing anything else.
The current behavior is that Filament incorrectly says the select dropdown is required. Which it is, but the first value is already selected. If you select a different value, then the first one again, it works as expected.
The expected behavior would be to get an Exception with a SQL error because I haven't included all the required fields for the default Laravel user. A full form that throws no exceptions doesn't change anything.
Reproduction repository (issue will be closed if this is not valid)
https://github.com/lancepioch/filament-bug
Relevant log output
No response
The text was updated successfully, but these errors were encountered: