From af07fb77e7bd8809cf33e77a444b8b57f63b371a Mon Sep 17 00:00:00 2001 From: 2betop <2698393+2betop@users.noreply.github.com> Date: Fri, 22 Nov 2024 17:46:59 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=A4=9A=E4=B8=AA=20c?= =?UTF-8?q?rud=20=E5=B9=B6=E5=88=97=E4=B8=94=E9=83=BD=E5=BC=80=E5=90=AF?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E6=92=91=E5=BC=80=E6=A8=A1=E5=BC=8F=E6=97=B6?= =?UTF-8?q?=E9=AB=98=E5=BA=A6=E8=AE=A1=E7=AE=97=E9=94=99=E8=AF=AF=E9=97=AE?= =?UTF-8?q?=E9=A2=98=20Close:=20#10981=20Close:=20#11068?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/amis/src/renderers/Table/index.tsx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/packages/amis/src/renderers/Table/index.tsx b/packages/amis/src/renderers/Table/index.tsx index d8ef56bd5..ef691e9f5 100644 --- a/packages/amis/src/renderers/Table/index.tsx +++ b/packages/amis/src/renderers/Table/index.tsx @@ -861,9 +861,14 @@ export default class Table extends React.Component { 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;