mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-20 12:23:02 +00:00
fix(data-table): expandable rows should work with zebra styles
This commit is contained in:
parent
912d3796f0
commit
6587691f58
1 changed files with 4 additions and 1 deletions
|
@ -356,6 +356,7 @@
|
||||||
{#each sorting ? displayedSortedRows : displayedRows as row, i (row.id)}
|
{#each sorting ? displayedSortedRows : displayedRows as row, i (row.id)}
|
||||||
<TableRow
|
<TableRow
|
||||||
id="row-{row.id}"
|
id="row-{row.id}"
|
||||||
|
data-parent-row="{expandable ? true : undefined}"
|
||||||
class="{selectedRowIds.includes(row.id)
|
class="{selectedRowIds.includes(row.id)
|
||||||
? 'bx--data-table--selected'
|
? 'bx--data-table--selected'
|
||||||
: ''} {expandedRows[row.id] ? 'bx--expandable-row' : ''} {expandable
|
: ''} {expandedRows[row.id] ? 'bx--expandable-row' : ''} {expandable
|
||||||
|
@ -483,14 +484,16 @@
|
||||||
{/each}
|
{/each}
|
||||||
</TableRow>
|
</TableRow>
|
||||||
|
|
||||||
{#if expandable && expandedRows[row.id] && !nonExpandableRowIds.includes(row.id)}
|
{#if expandable}
|
||||||
<tr
|
<tr
|
||||||
data-child-row
|
data-child-row
|
||||||
class:bx--expandable-row="{true}"
|
class:bx--expandable-row="{true}"
|
||||||
on:mouseenter="{() => {
|
on:mouseenter="{() => {
|
||||||
|
if (nonExpandableRowIds.includes(row.id)) return;
|
||||||
parentRowId = row.id;
|
parentRowId = row.id;
|
||||||
}}"
|
}}"
|
||||||
on:mouseleave="{() => {
|
on:mouseleave="{() => {
|
||||||
|
if (nonExpandableRowIds.includes(row.id)) return;
|
||||||
parentRowId = null;
|
parentRowId = null;
|
||||||
}}"
|
}}"
|
||||||
>
|
>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue