F
Filament2y ago
Abi

Default Selection for Select Field

I have the following array I am binding to a Select field. And setting the default('text-gray-900) and it doesn't work when the field is set to searchable. If I disable searchable then the default value works.
4 Replies
Abi
AbiOP2y ago
For some reason, I am having the same issue with the TextInput as well. The default isn't getting set. Here is the code for the Text Input
TextInput::make('button_text')
->label('Button Text')
->default('Get Started')
->required(),
TextInput::make('button_text')
->label('Button Text')
->default('Get Started')
->required(),
toeknee
toeknee2y ago
Are you editing an existing record or creating a new one?
Abi
AbiOP2y ago
existing record ok, makes sense, my bad..
LeandroFerreira
You may use afterStateHydrated if you want
Want results from more Discord servers?
Add your server