fix: 修复表格自适应高度导致滚动条问题 (#2915)

* chore: 更新版本

* fix: 修复表格自适应高度导致滚动条问题
This commit is contained in:
吴多益 2021-11-11 13:23:06 +08:00 committed by GitHub
parent 73737e64ae
commit fb80de7405
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 12 deletions

View File

@ -893,6 +893,7 @@
}
&--autoFillHeight {
margin-bottom: 0;
> .#{$ns}Table-contentWrap {
> .#{$ns}Table-content table {
border-top: none; // 不然会导致拖动时顶部露出内容
@ -903,6 +904,12 @@
z-index: 1; // 由于 badge 导致 tbody tr position: relative
}
}
> .#{$ns}Table-fixedTop {
display: none;
}
> .#{$ns}Table-footToolbar {
margin-bottom: 0;
}
}
}

View File

@ -637,8 +637,6 @@ export default class Table extends React.Component<TableProps, object> {
return;
}
// table 底部 margin
const tableMarginBottom = getStyleNumber(table, 'margin-bottom');
// 计算 table-content 在 dom 中的位置
const tableContentTop = offset(tableContent).top;
const viewportHeight = window.innerHeight;
@ -651,11 +649,6 @@ export default class Table extends React.Component<TableProps, object> {
}, 100);
return;
}
const footToolbarMarginBottom = getStyleNumber(
footToolbar,
'margin-bottom'
);
const tableContentWrapMarginButtom = getStyleNumber(
tableContentWrap,
'margin-bottom'
@ -677,11 +670,7 @@ export default class Table extends React.Component<TableProps, object> {
tableContentTop -
tableContentWrapMarginButtom -
footToolbarHeight -
Math.max(
footToolbarMarginBottom,
allParentPaddingButtom,
tableMarginBottom
)
allParentPaddingButtom
}px`;
}