Skip to content

Commit d8def22

Browse files
authored
chore: end fixed zIndex should smaller than start (#1249)
1 parent 1f21ae4 commit d8def22

File tree

5 files changed

+118
-118
lines changed

5 files changed

+118
-118
lines changed

src/utils/fixUtil.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,12 @@ export function getCellFixedInfo(
6161
if (fixStart !== null) {
6262
fixedStartShadow = !columns[colEnd + 1] || !isFixedStart(columns[colEnd + 1]);
6363
zIndex = columns.length * 2 - colStart; // Fix start always overlay fix end
64-
zIndexReverse = colStart;
64+
zIndexReverse = columns.length + colStart;
6565
}
6666
if (fixEnd !== null) {
6767
fixedEndShadow = !columns[colStart - 1] || !isFixedEnd(columns[colStart - 1]);
6868
zIndex = colEnd;
69-
zIndexReverse = columns.length * 2 - colEnd; // Fix end always overlay fix start
69+
zIndexReverse = columns.length - colEnd; // Fix end always overlay fix start
7070
}
7171

7272
// Check if scrollLeft will show the shadow

tests/__snapshots__/ExpandRow.spec.jsx.snap

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -461,12 +461,12 @@ exports[`Table.Expand > renders fixed column correctly > work 1`] = `
461461
<tr>
462462
<th
463463
class="rc-table-cell rc-table-row-expand-icon-cell rc-table-cell-fix rc-table-cell-fix-start"
464-
style="inset-inline-start: 0; --z-offset: 8; --z-offset-reverse: 0;"
464+
style="inset-inline-start: 0; --z-offset: 8; --z-offset-reverse: 4;"
465465
/>
466466
<th
467467
class="rc-table-cell rc-table-cell-fix rc-table-cell-fix-start rc-table-cell-fix-start-shadow"
468468
scope="col"
469-
style="inset-inline-start: 0; --z-offset: 7; --z-offset-reverse: 1;"
469+
style="inset-inline-start: 0; --z-offset: 7; --z-offset-reverse: 5;"
470470
>
471471
Name
472472
</th>
@@ -479,7 +479,7 @@ exports[`Table.Expand > renders fixed column correctly > work 1`] = `
479479
<th
480480
class="rc-table-cell rc-table-cell-fix rc-table-cell-fix-end rc-table-cell-fix-end-shadow"
481481
scope="col"
482-
style="inset-inline-end: 0; --z-offset: 3; --z-offset-reverse: 5;"
482+
style="inset-inline-end: 0; --z-offset: 3; --z-offset-reverse: 1;"
483483
>
484484
Gender
485485
</th>
@@ -536,15 +536,15 @@ exports[`Table.Expand > renders fixed column correctly > work 1`] = `
536536
>
537537
<td
538538
class="rc-table-cell rc-table-row-expand-icon-cell rc-table-cell-fix rc-table-cell-fix-start"
539-
style="inset-inline-start: 0; --z-offset: 8; --z-offset-reverse: 0;"
539+
style="inset-inline-start: 0; --z-offset: 8; --z-offset-reverse: 4;"
540540
>
541541
<span
542542
class="rc-table-row-expand-icon rc-table-row-expanded"
543543
/>
544544
</td>
545545
<td
546546
class="rc-table-cell rc-table-cell-fix rc-table-cell-fix-start rc-table-cell-fix-start-shadow"
547-
style="inset-inline-start: 0; --z-offset: 7; --z-offset-reverse: 1;"
547+
style="inset-inline-start: 0; --z-offset: 7; --z-offset-reverse: 5;"
548548
>
549549
Lucy
550550
</td>
@@ -555,7 +555,7 @@ exports[`Table.Expand > renders fixed column correctly > work 1`] = `
555555
</td>
556556
<td
557557
class="rc-table-cell rc-table-cell-fix rc-table-cell-fix-end rc-table-cell-fix-end-shadow"
558-
style="inset-inline-end: 0; --z-offset: 3; --z-offset-reverse: 5;"
558+
style="inset-inline-end: 0; --z-offset: 3; --z-offset-reverse: 1;"
559559
>
560560
F
561561
</td>
@@ -583,15 +583,15 @@ exports[`Table.Expand > renders fixed column correctly > work 1`] = `
583583
>
584584
<td
585585
class="rc-table-cell rc-table-row-expand-icon-cell rc-table-cell-fix rc-table-cell-fix-start"
586-
style="inset-inline-start: 0; --z-offset: 8; --z-offset-reverse: 0;"
586+
style="inset-inline-start: 0; --z-offset: 8; --z-offset-reverse: 4;"
587587
>
588588
<span
589589
class="rc-table-row-expand-icon rc-table-row-expanded"
590590
/>
591591
</td>
592592
<td
593593
class="rc-table-cell rc-table-cell-fix rc-table-cell-fix-start rc-table-cell-fix-start-shadow"
594-
style="inset-inline-start: 0; --z-offset: 7; --z-offset-reverse: 1;"
594+
style="inset-inline-start: 0; --z-offset: 7; --z-offset-reverse: 5;"
595595
>
596596
Jack
597597
</td>
@@ -602,7 +602,7 @@ exports[`Table.Expand > renders fixed column correctly > work 1`] = `
602602
</td>
603603
<td
604604
class="rc-table-cell rc-table-cell-fix rc-table-cell-fix-end rc-table-cell-fix-end-shadow"
605-
style="inset-inline-end: 0; --z-offset: 3; --z-offset-reverse: 5;"
605+
style="inset-inline-end: 0; --z-offset: 3; --z-offset-reverse: 1;"
606606
>
607607
M
608608
</td>
@@ -1072,7 +1072,7 @@ exports[`Table.Expand > work in expandable fix 2`] = `
10721072
</th>
10731073
<th
10741074
class="rc-table-cell rc-table-row-expand-icon-cell rc-table-cell-fix rc-table-cell-fix-start rc-table-cell-fix-start-shadow"
1075-
style="inset-inline-start: 0; --z-offset: 5; --z-offset-reverse: 3;"
1075+
style="inset-inline-start: 0; --z-offset: 5; --z-offset-reverse: 7;"
10761076
/>
10771077
</tr>
10781078
</thead>
@@ -1142,7 +1142,7 @@ exports[`Table.Expand > work in expandable fix 2`] = `
11421142
</td>
11431143
<td
11441144
class="rc-table-cell rc-table-row-expand-icon-cell rc-table-cell-fix rc-table-cell-fix-start rc-table-cell-fix-start-shadow"
1145-
style="inset-inline-start: 0; --z-offset: 5; --z-offset-reverse: 3;"
1145+
style="inset-inline-start: 0; --z-offset: 5; --z-offset-reverse: 7;"
11461146
>
11471147
<span
11481148
class="rc-table-row-expand-icon rc-table-row-collapsed"
@@ -1170,7 +1170,7 @@ exports[`Table.Expand > work in expandable fix 2`] = `
11701170
</td>
11711171
<td
11721172
class="rc-table-cell rc-table-row-expand-icon-cell rc-table-cell-fix rc-table-cell-fix-start rc-table-cell-fix-start-shadow"
1173-
style="inset-inline-start: 0; --z-offset: 5; --z-offset-reverse: 3;"
1173+
style="inset-inline-start: 0; --z-offset: 5; --z-offset-reverse: 7;"
11741174
>
11751175
<span
11761176
class="rc-table-row-expand-icon rc-table-row-collapsed"

0 commit comments

Comments
 (0)