Skip to content

Commit

Permalink
feat: only mount collapsed cell content when expanded (#302)
Browse files Browse the repository at this point in the history
  • Loading branch information
Fran McDade authored and Fran McDade committed Jan 2, 2025
1 parent 6dae176 commit f0c0d4b
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,10 @@ export const CollapsableCell = <T extends RowData>({
</PinnedCell>
<Collapse
in={row.getIsExpanded()}
mountOnEnter
onEntered={() => virtualizer?.measure()} // Measure when cell is opened.
onExited={() => virtualizer?.measure()} // Measure when cell is closed.
unmountOnExit
>
<CollapsedContents>
{getRowVisibleCells(row).map((cell, i) => {
Expand Down

0 comments on commit f0c0d4b

Please sign in to comment.