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 Thai6mo ago
Hi bro, did you find any solution yet?
krekas
krekas6mo ago
The solution is posted in the link above
Hung Thai
Hung Thai6mo ago
sorry I replied to the wrong thread

Did you find this page helpful?