F
Filament5mo 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
MikailOP5mo ago
hi
Lara Zeus
Lara Zeus5mo 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
MikailOP4mo 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
toeknee4mo ago
have you overridden the colors in the panel provider?
Mikail
MikailOP4mo 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

Did you find this page helpful?