Skip to content

Commit

Permalink
Merge pull request #11251 from 2betop/fix-crud-autoFillHeight
Browse files Browse the repository at this point in the history
fix: 修复多个 crud 并列且都开启自动撑开模式时高度计算错误问题 Close: #10981 Close: #11068
  • Loading branch information
hsm-lv authored Nov 25, 2024
2 parents ad9c8d7 + af07fb7 commit 364eb08
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions packages/amis/src/renderers/Table/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -868,9 +868,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;
Expand Down

0 comments on commit 364eb08

Please sign in to comment.