修复有超级表头时 itemActions 位置显示不正确的问题

This commit is contained in:
2betop 2020-06-11 19:15:27 +08:00
parent 871c84981b
commit 5575a1d6a1
1 changed files with 4 additions and 1 deletions

View File

@ -585,10 +585,13 @@ export default class Table extends React.Component<TableProps, object> {
let heights: {
[propName: string]: number;
} = (this.heights = {});
heights.header ||
(heights.header = table.querySelector('thead')!.offsetHeight);
forEach(
table.querySelectorAll('thead>tr:last-child>th'),
(item: HTMLElement) => {
heights.header || (heights.header = item.offsetHeight);
widths[item.getAttribute('data-index') as string] = item.offsetWidth;
}
);