Merge pull request #11251 from 2betop/fix-crud-autoFillHeight

fix: 修复多个 crud 并列且都开启自动撑开模式时高度计算错误问题 Close: #10981 Close: #11068
This commit is contained in:
hsm-lv 2024-11-25 12:56:02 +08:00 committed by GitHub
commit 364eb08dd2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

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