#ColorPicker Required Bug

31 messages · Page 1 of 1 (latest)

pseudo glade
#

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.

Forms\Components\ColorPicker::make('primary_color')
   ->label('Cor')
   ->required()

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.

lone relicBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> ✅ Mark Solution

merry heath
#

Do you get this error when editing? or also when creating a record?

pseudo glade
#

Sorry by the late guys.

Creating and editing.

Yep @lone fjord , 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.

lone fjord
pseudo glade
#

No, It doesn't Leandro... If I change to TextInput it does, but as ColorPicker doesn't.

lone fjord
#

console errors?

pseudo glade
#

No console erros 😦

I'm with a custom page...

#

I'm creating the page again reviewing everything

#

Following the doc again

lone fjord
pseudo glade
#

Maybe I forget something, the weird is that with TextInput it works, and ColorPicker it doesn't

#

Yep @lone fjord, 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');

lone fjord
#

I mean, as login, register..

pseudo glade
#

My ConfirmSignup I extend from Filament\Pages\Page

#

And login, is the same from filament, just change the layout

lone fjord
pseudo glade
#

"filament/filament": "^3.2.83",

#

Guy, I found the problem

#

My fault...

#

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 @lone fjord

lone relicBOT
lone fjord