|
26 | 26 |
|
27 | 27 | import * as React from 'react';
|
28 | 28 | import isVisible from 'rc-util/lib/Dom/isVisible';
|
| 29 | +import pickAttrs from 'rc-util/lib/pickAttrs'; |
29 | 30 | import { isStyleSupport } from 'rc-util/lib/Dom/styleChecker';
|
30 | 31 | import classNames from 'classnames';
|
31 | 32 | import shallowEqual from 'shallowequal';
|
@@ -64,7 +65,7 @@ import { getPathValue, mergeObject, validateValue, getColumnsKey } from './utils
|
64 | 65 | import ResizeContext from './context/ResizeContext';
|
65 | 66 | import useStickyOffsets from './hooks/useStickyOffsets';
|
66 | 67 | import ColGroup from './ColGroup';
|
67 |
| -import { getExpandableProps, getDataAndAriaProps } from './utils/legacyUtil'; |
| 68 | +import { getExpandableProps } from './utils/legacyUtil'; |
68 | 69 | import Panel from './Panel';
|
69 | 70 | import Footer, { FooterComponents } from './Footer';
|
70 | 71 | import { findAllChildrenKeys, renderExpandIcon } from './utils/expandUtil';
|
@@ -338,6 +339,17 @@ function Table<RecordType extends DefaultRecordType>(props: TableProps<RecordTyp
|
338 | 339 | [getRowKey, mergedExpandedKeys, mergedData, onExpand, onExpandedRowsChange],
|
339 | 340 | );
|
340 | 341 |
|
| 342 | + // Warning if use `expandedRowRender` and nest children in the same time |
| 343 | + if ( |
| 344 | + process.env.NODE_ENV !== 'production' && |
| 345 | + expandedRowRender && |
| 346 | + mergedData.some((record: RecordType) => { |
| 347 | + return Array.isArray(record?.[mergedChildrenColumnName]); |
| 348 | + }) |
| 349 | + ) { |
| 350 | + warning(false, '`expandedRowRender` should not use with nested Table'); |
| 351 | + } |
| 352 | + |
341 | 353 | // ====================== Column ======================
|
342 | 354 | const [componentWidth, setComponentWidth] = React.useState(0);
|
343 | 355 |
|
@@ -725,7 +737,7 @@ function Table<RecordType extends DefaultRecordType>(props: TableProps<RecordTyp
|
725 | 737 | );
|
726 | 738 | }
|
727 | 739 |
|
728 |
| - const ariaProps = getDataAndAriaProps(props); |
| 740 | + const ariaProps = pickAttrs(props, { aria: true, data: true }); |
729 | 741 |
|
730 | 742 | let fullTable = (
|
731 | 743 | <div
|
|
0 commit comments