perf(data-table): only render table row content when expanded

Closes #1209
This commit is contained in:
Eric Liu 2022-03-25 06:08:15 -07:00
commit 91e5b7be29

View file

@ -497,13 +497,15 @@
parentRowId = null; parentRowId = null;
}}" }}"
> >
<TableCell {#if expandedRows[row.id] && !nonExpandableRowIds.includes(row.id)}
colspan="{selectable ? headers.length + 2 : headers.length + 1}" <TableCell
> colspan="{selectable ? headers.length + 2 : headers.length + 1}"
<div class:bx--child-row-inner-container="{true}"> >
<slot name="expanded-row" row="{row}" /> <div class:bx--child-row-inner-container="{true}">
</div> <slot name="expanded-row" row="{row}" />
</TableCell> </div>
</TableCell>
{/if}
</tr> </tr>
{/if} {/if}
{/each} {/each}