isLimited combined with getTableRecordActionUsing breaks

Using the table package, I created a table in a Livewire component. Everything works, until I add the combination of an expandableList and getTableRecordActionUsing() The problem is getTableRecordActionUsing() adds a wrapper button on every cell in the table, but the button to toggle isLimited, is put outside of this wrapper. Thus Alpine throwing an error because the isLimited alpine object, it outside of the scope of the "show more" button. Is this a Filament bug? or Am I doing something wrong?
3 Replies
Dennis Koch
Dennis Koch5mo ago
Can you share a short code example?
Remi Hindriks
Remi HindriksOP5mo ago
@Dennis Koch certainly: a User hasMany InstructorLevel created a custom Livewire table component like you always would add
protected function getTableRecordActionUsing(): ?Closure
{
return fn (): string => 'view';
}
protected function getTableRecordActionUsing(): ?Closure
{
return fn (): string => 'view';
}
TextColumn::make('instructorLevels')
->label(__('Instructor level'))
->color('warning')
->getStateUsing(function (Customer $record) {
$levels = $record
->levels()
->orderByDesc('level')
->get()
->unique('discipline_id');

return $levels->map(fn ($item) => $item->discipline->name . '-' . ($item->level));
})
->badge()
->expandableLimitedList()
->limitList(2)
->listWithLineBreaks()
->distinctList(),
TextColumn::make('instructorLevels')
->label(__('Instructor level'))
->color('warning')
->getStateUsing(function (Customer $record) {
$levels = $record
->levels()
->orderByDesc('level')
->get()
->unique('discipline_id');

return $levels->map(fn ($item) => $item->discipline->name . '-' . ($item->level));
})
->badge()
->expandableLimitedList()
->limitList(2)
->listWithLineBreaks()
->distinctList(),
Console gives error, "show more" isnt shown. When you inspect the code, you find the button to toggle isLimited is outside the x-data scope where islimited is defined. a button element is added around the <ul> element that triggers the view action. Which closes before the show-more-button
Dennis Koch
Dennis Koch5mo ago
You are probably using the ViewModal? Probably nothing I can help with. Can you open an issue on Github for this?
Want results from more Discord servers?
Add your server