Skip to content

Commit

Permalink
fix: 修复多个 crud 并列且都开启自动撑开模式时高度计算错误问题 Close: #10981 Close: #11068
Browse files Browse the repository at this point in the history
  • Loading branch information
2betop committed Nov 22, 2024
1 parent 3d07dd2 commit af07fb7
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 @@ -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;
Expand Down

0 comments on commit af07fb7

Please sign in to comment.