webrix icon indicating copy to clipboard operation
webrix copied to clipboard

Avoid rendering content when collapsed

Open ykadosh opened this issue 3 years ago • 0 comments

Currently, the Collapsible component renders its content regardless of whether it's expanded or not. It does so in order to be able to calculate the height to which it needs to expand.

This can lead to performance issues when you have many Collapsible elements on the screen. And even for a single item, it's redundant to render what the user doesn't see.

The solution is to not render the content when expanded is false, but when it's changing to true, render it collapsed, capture the height, and then expand.

ykadosh avatar Apr 26 '21 20:04 ykadosh