fix: 修复多个 crud 并列且都开启自动撑开模式时高度计算错误问题 Close: #10981 Close: #11068

This commit is contained in:
2betop 2024-11-22 17:46:59 +08:00
parent 3d07dd2870
commit af07fb77e7

View File

@ -861,9 +861,14 @@ export default class Table extends React.Component<TableProps, object> {
while (nextSibling) {
const positon = getComputedStyle(nextSibling).position;
if (positon !== 'absolute' && positon !== 'fixed') {
nextSiblingHeight +=
nextSibling.offsetHeight +
getStyleNumber(nextSibling, 'margin-bottom');
const rect1 = selfNode.getBoundingClientRect();
const rect2 = nextSibling.getBoundingClientRect();
if (rect1.bottom <= rect2.top) {
nextSiblingHeight +=
nextSibling.offsetHeight +
getStyleNumber(nextSibling, 'margin-bottom');
}
}
nextSibling = nextSibling.nextElementSibling as HTMLElement;