Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 在容器组件左右布局里,2个crud组件开启内容自适应,第一个crud组件无法填充展示的bug修复 #10981 #11068

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions packages/amis/src/renderers/Table/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -859,11 +859,19 @@ export default class Table extends React.Component<TableProps, object> {
let nextSiblingHeight = 0;
let nextSibling = selfNode.nextElementSibling as HTMLElement;
while (nextSibling) {
const positon = getComputedStyle(nextSibling).position;
if (positon !== 'absolute' && positon !== 'fixed') {
nextSiblingHeight +=
nextSibling.offsetHeight +
getStyleNumber(nextSibling, 'margin-bottom');
//TODO 这里先做容器组件的兼容处理,希望大佬们能优化一下
// 如果下一个兄弟节点不是 cxd-Container,cxd-Grid-col--xxx2种容器,则计算下一个兄弟节点的高度
let classString = Array.from(nextSibling.classList).join(',');
if (
classString.indexOf(`${ns}Container`) < 0 &&
classString.indexOf(`${ns}Grid-col--`) < 0
) {
const positon = getComputedStyle(nextSibling).position;
if (positon !== 'absolute' && positon !== 'fixed') {
nextSiblingHeight +=
nextSibling.offsetHeight +
getStyleNumber(nextSibling, 'margin-bottom');
}
}

nextSibling = nextSibling.nextElementSibling as HTMLElement;
Expand Down
Loading