fix(data-table): expandable rows should work with zebra styles (#1200)

Fixes #1199
This commit is contained in:
metonym 2022-03-23 08:04:08 -07:00 committed by GitHub
commit 53fdbdf991
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 73 additions and 1 deletions

View file

@ -356,6 +356,7 @@
{#each sorting ? displayedSortedRows : displayedRows as row, i (row.id)}
<TableRow
id="row-{row.id}"
data-parent-row="{expandable ? true : undefined}"
class="{selectedRowIds.includes(row.id)
? 'bx--data-table--selected'
: ''} {expandedRows[row.id] ? 'bx--expandable-row' : ''} {expandable
@ -483,14 +484,16 @@
{/each}
</TableRow>
{#if expandable && expandedRows[row.id] && !nonExpandableRowIds.includes(row.id)}
{#if expandable}
<tr
data-child-row
class:bx--expandable-row="{true}"
on:mouseenter="{() => {
if (nonExpandableRowIds.includes(row.id)) return;
parentRowId = row.id;
}}"
on:mouseleave="{() => {
if (nonExpandableRowIds.includes(row.id)) return;
parentRowId = null;
}}"
>