Skip to content

Commit

Permalink
Merge pull request #11611 from tpto/master
Browse files Browse the repository at this point in the history
fix: Firefox浏览器Crud设置autoFillHeight,无数据时表头被拉伸
  • Loading branch information
hsm-lv authored Feb 20, 2025
2 parents a39a5a3 + ff00915 commit 50fae24
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/amis-ui/scss/components/_table.scss
Original file line number Diff line number Diff line change
Expand Up @@ -1032,7 +1032,11 @@
border-top: none; // 不然会导致拖动时顶部露出内容

&.#{$ns}Table-table--tableFillHeight {
min-height: 100%; // 为了让表格占满高度
> tbody {
height: calc(
var(--Table-content-height) - var(--Table-thead-height)
);
}
}
}

Expand Down
4 changes: 4 additions & 0 deletions packages/amis/src/renderers/Table/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -952,6 +952,10 @@ export default class Table<
)}px`;

tableContent.style[heightField] = tableContentHeight;
tableContent.style.setProperty(
`--Table-content-${heightField}`,
tableContentHeight
);
}

componentDidUpdate(prevProps: TableProps) {
Expand Down

0 comments on commit 50fae24

Please sign in to comment.