Skip to content

Commit a5c1d8b

Browse files
committed
chore: add comment
1 parent d3eead2 commit a5c1d8b

File tree

3 files changed

+21
-9
lines changed

3 files changed

+21
-9
lines changed

docs/examples/scrollXY.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@ const columns: TableProps['columns'] = [
2020

2121
const data = [
2222
{ a: '123', b: 'xxxxxxxx xxxxxxxx', d: 3, key: '1' },
23-
{ a: 'cdd', b: 'edd12221 edd12221', d: 3, key: '2' },
24-
{ a: '133', c: 'edd12221 edd12221', d: 2, key: '3' },
25-
{ a: '133', c: 'edd12221 edd12221', d: 2, key: '4' },
26-
{ a: '133', c: 'edd12221 edd12221', d: 2, key: '5' },
27-
{ a: '133', c: 'edd12221 edd12221', d: 2, key: '6' },
28-
{ a: '133', c: 'edd12221 edd12221', d: 2, key: '7' },
29-
{ a: '133', c: 'edd12221 edd12221', d: 2, key: '8' },
30-
{ a: '133', c: 'edd12221 edd12221', d: 2, key: '9' },
23+
// { a: 'cdd', b: 'edd12221 edd12221', d: 3, key: '2' },
24+
// { a: '133', c: 'edd12221 edd12221', d: 2, key: '3' },
25+
// { a: '133', c: 'edd12221 edd12221', d: 2, key: '4' },
26+
// { a: '133', c: 'edd12221 edd12221', d: 2, key: '5' },
27+
// { a: '133', c: 'edd12221 edd12221', d: 2, key: '6' },
28+
// { a: '133', c: 'edd12221 edd12221', d: 2, key: '7' },
29+
// { a: '133', c: 'edd12221 edd12221', d: 2, key: '8' },
30+
// { a: '133', c: 'edd12221 edd12221', d: 2, key: '9' },
3131
];
3232

3333
const Demo = () => {

src/Cell/index.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,12 @@ function Cell<RecordType>(props: CellProps<RecordType>) {
121121
'rowHoverable',
122122
]);
123123

124+
useContext(TableContext, ({ scrollInfo }) => {
125+
if (fixedStartShadow) {
126+
console.log('~~~>', fixedStartShadow, scrollInfo);
127+
}
128+
});
129+
124130
// ====================== Value =======================
125131
const [childNode, legacyCellProps] = useCellRender(
126132
record,

src/utils/fixUtil.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@ export interface FixedInfo {
1313
fixedEndShadow?: boolean;
1414

1515
zIndex?: number;
16+
17+
/** Get the scroll position of the scrollbar at
18+
* which the current `fixed: start` needs to display a shadow */
19+
stickyStart?: number;
20+
/** Get the scroll position of the scrollbar at
21+
* which the current `fixed: end` needs to display a shadow */
22+
stickyEnd?: number;
1623
}
1724

1825
function isFixedStart(column: { fixed?: FixedType }) {
@@ -47,7 +54,6 @@ export function getCellFixedInfo(
4754
// Calc `zIndex`.
4855
// first fixed start (start -> end) column `zIndex` should be greater than next column.
4956
// first fixed end (end -> start) column `zIndex` should be greater than next column.
50-
5157
let zIndex = 0;
5258

5359
if (fixStart !== null) {

0 commit comments

Comments
 (0)