F
Filament3mo ago
Mikail

badge color is not reactive on table

TextInputColumn::make('test_2'), TextColumn::make('total') ->badge() ->color(fn (string $state): string => $state <= $failedGrade ? 'danger' : '') I have a testinput like this that update the total column. Total column get updated but badge color does not get updated until page reload. Any way to make badge color also reactive on table?
5 Replies
Mikail
MikailOP3mo ago
hi
Lara Zeus
Lara Zeus3mo ago
seams working:
Tables\Columns\TextInputColumn::make('name'),
TextColumn::make('id')
->badge()
->color(fn(Package $record)=>$record->name === 'Thunder' ? 'danger' : 'info')
Tables\Columns\TextInputColumn::make('name'),
TextColumn::make('id')
->badge()
->color(fn(Package $record)=>$record->name === 'Thunder' ? 'danger' : 'info')
Mikail
MikailOP3mo ago
Indeed. But I can't figure out why mine is not. I have latest Filament version. TextInputColumn::make('discipline'), TextColumn::make('id') ->badge() ->color(fn ($record): string => $record->discipline === 'art' ? 'danger' : ''),
toeknee
toeknee3mo ago
have you overridden the colors in the panel provider?
Mikail
MikailOP3mo ago
nope. color won't update until page reload it did work correctly when i set the default value to a neutral color like 'gray' rather than empty ''. Thanks
Want results from more Discord servers?
Add your server