Adding a "show more/less" toggle to long description in infolist

I have an infolist with a description TextEntry component that renders HTML. However some of the descriptions are quite long, so I would like to include a toggle button saying "show more" or "show less" to expand and shrink the content.

public function infolist(Infolist $infolist): Infolist
{
return $infolist
->record($this->product)
->schema(
TextEntry::make('description')
->html(),
);
}

public function infolist(Infolist $infolist): Infolist
{
return $infolist
->record($this->product)
->schema(
TextEntry::make('description')
->html(),
);
}
4 Replies
Hung Thai
Hung Thai4mo ago
Hi bro, did you find any solution yet?
krekas
krekas4mo ago
The solution is posted in the link above
Hung Thai
Hung Thai4mo ago
sorry I replied to the wrong thread
Want results from more Discord servers?
Add your server