Skip to content

Commit c228e5d

Browse files
committed
fix: scroll className logic
1 parent 6bd9b2f commit c228e5d

File tree

4 files changed

+10
-8
lines changed

4 files changed

+10
-8
lines changed

src/Table.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -626,7 +626,9 @@ function Table<RecordType extends DefaultRecordType>(props: TableProps<RecordTyp
626626
[`${prefixCls}-ping-right`]: pingedRight,
627627
[`${prefixCls}-layout-fixed`]: tableLayout === 'fixed',
628628
[`${prefixCls}-fixed-header`]: fixHeader,
629+
/** No used but for compatible */
629630
[`${prefixCls}-fixed-column`]: fixColumn,
631+
[`${prefixCls}-scroll-horizontal`]: horizonScroll,
630632
[`${prefixCls}-has-fix-left`]: flattenColumns[0] && flattenColumns[0].fixed,
631633
[`${prefixCls}-has-fix-right`]:
632634
flattenColumns[flattenColumns.length - 1] &&

tests/__snapshots__/ExpandRow.spec.js.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ exports[`Table.Expand childrenColumnName 1`] = `
105105

106106
exports[`Table.Expand renders fixed column correctly work 1`] = `
107107
<div
108-
class="rc-table rc-table-fixed-column rc-table-has-fix-left rc-table-has-fix-right"
108+
class="rc-table rc-table-fixed-column rc-table-scroll-horizontal rc-table-has-fix-left rc-table-has-fix-right"
109109
>
110110
<div
111111
class="rc-table-container"

tests/__snapshots__/FixedColumn.spec.js.snap

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
exports[`Table.FixedColumn fixed column renders correctly RTL 1`] = `
44
<div
5-
class="rc-table rc-table-rtl rc-table-fixed-column rc-table-has-fix-left"
5+
class="rc-table rc-table-rtl rc-table-fixed-column rc-table-scroll-horizontal rc-table-has-fix-left"
66
>
77
<div
88
class="rc-table-container"
@@ -625,7 +625,7 @@ exports[`Table.FixedColumn fixed column renders correctly RTL 1`] = `
625625

626626
exports[`Table.FixedColumn renders correctly scrollX - with data 1`] = `
627627
<div
628-
class="rc-table rc-table-fixed-column rc-table-has-fix-left rc-table-has-fix-right"
628+
class="rc-table rc-table-fixed-column rc-table-scroll-horizontal rc-table-has-fix-left rc-table-has-fix-right"
629629
>
630630
<div
631631
class="rc-table-container"
@@ -1248,7 +1248,7 @@ exports[`Table.FixedColumn renders correctly scrollX - with data 1`] = `
12481248

12491249
exports[`Table.FixedColumn renders correctly scrollX - without data 1`] = `
12501250
<div
1251-
class="rc-table rc-table-fixed-column rc-table-has-fix-left rc-table-has-fix-right"
1251+
class="rc-table rc-table-fixed-column rc-table-scroll-horizontal rc-table-has-fix-left rc-table-has-fix-right"
12521252
>
12531253
<div
12541254
class="rc-table-container"
@@ -1418,7 +1418,7 @@ exports[`Table.FixedColumn renders correctly scrollX - without data 1`] = `
14181418

14191419
exports[`Table.FixedColumn renders correctly scrollXY - with data 1`] = `
14201420
<div
1421-
class="rc-table rc-table-fixed-header rc-table-fixed-column rc-table-has-fix-left rc-table-has-fix-right"
1421+
class="rc-table rc-table-fixed-header rc-table-fixed-column rc-table-scroll-horizontal rc-table-has-fix-left rc-table-has-fix-right"
14221422
>
14231423
<div
14241424
class="rc-table-container"
@@ -2073,7 +2073,7 @@ exports[`Table.FixedColumn renders correctly scrollXY - with data 1`] = `
20732073

20742074
exports[`Table.FixedColumn renders correctly scrollXY - without data 1`] = `
20752075
<div
2076-
class="rc-table rc-table-fixed-column rc-table-has-fix-left rc-table-has-fix-right"
2076+
class="rc-table rc-table-fixed-column rc-table-scroll-horizontal rc-table-has-fix-left rc-table-has-fix-right"
20772077
>
20782078
<div
20792079
class="rc-table-container"

tests/__snapshots__/Table.spec.js.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ exports[`Table.Basic custom components renders correctly 1`] = `
6767

6868
exports[`Table.Basic custom components renders fixed column and header correctly 1`] = `
6969
<div
70-
class="rc-table rc-table-fixed-header rc-table-fixed-column rc-table-has-fix-left rc-table-has-fix-right"
70+
class="rc-table rc-table-fixed-header rc-table-fixed-column rc-table-scroll-horizontal rc-table-has-fix-left rc-table-has-fix-right"
7171
>
7272
<div
7373
class="rc-table-container"
@@ -186,7 +186,7 @@ exports[`Table.Basic custom components renders fixed column and header correctly
186186

187187
exports[`Table.Basic custom components scroll content with scroll 1`] = `
188188
<div
189-
class="rc-table rc-table-fixed-header"
189+
class="rc-table rc-table-fixed-header rc-table-scroll-horizontal"
190190
>
191191
<div
192192
class="rc-table-container"

0 commit comments

Comments
 (0)