ColorPicker Required Bug
Guys,
I'm trying to use a color picker inside a Custom Livewire Page, using a form from Filament, and for some reason, the ColorPicker is not working as expected.
All other fields are working like a charm, but specifically, the Color Picker is always required, even with a filled value.
When I remove 'required' and debug the sent form, primary_color is received as null. If I keep required, form is not sended because requires value.
I'm using inside custom page like: {{ $this->form }}
I use the same with a lot other pages (without color picker) and it works.
I tried to upgrade all my packages but continue.
Solution:Jump to solution
I follow the doc, but I forgot to set the form fill on Mount
$this->form->fill();...
16 Replies
Do you get this error when editing? or also when creating a record?
Could you provide more info?
Did you follow this section? https://filamentphp.com/docs/3.x/forms/adding-a-form-to-a-livewire-component#adding-the-form
Sorry by the late guys.
Creating and editing.
Yep @Leandro Ferreira , If I remove color picker everything works fine, and if I change the colorPicker to a TextInput it works too.
It seems like the Color Picker is not updating the value into "model"
Because if I put the same value, ex #ffffff inside a TextInput and try to send the form, I receive the value correctly.
Does it show the value?
No, It doesn't Leandro... If I change to TextInput it does, but as ColorPicker doesn't.
Are you using the panel builder with a custom page or only the form builder?
console errors?
No console erros π¦
I'm with a custom page...
I'm creating the page again reviewing everything
Following the doc again
custom page in the panel builder?
Maybe I forget something, the weird is that with TextInput it works, and ColorPicker it doesn't
Yep @Leandro Ferreira, It's inside a Panel, I'm trying to create a "Confirm Signup" page after register
Ops, actually I define this route directly on my web.php.
Route::get('confirm-signup', ConfirmSignup::class)->name('auth.confirm-signup');
are you using a simple page?
I mean, as login, register..
My ConfirmSignup I extend from Filament\Pages\Page
And login, is the same from filament, just change the layout
filament version?
"filament/filament": "^3.2.83",
Guy, I found the problem
My fault...
Solution
I follow the doc, but I forgot to set the form fill on Mount
$this->form->fill();
I focused on TextInput working and keep my eyes out from the obvious.
Thanks for your help @Leandro Ferreira
That's why I asked if you had followed this section of the docs π€·ββοΈ