Skip to content

Commit

Permalink
fix(components): [table] maxHeight shark (#12349)
Browse files Browse the repository at this point in the history
  • Loading branch information
chenxch committed May 29, 2023
1 parent 9ba2ed7 commit 015ac09
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions packages/components/table/src/table/style-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -309,16 +309,12 @@ function useStyle<T>(
}
if (props.maxHeight) {
if (!Number.isNaN(Number(props.maxHeight))) {
const maxHeight = props.maxHeight
const reachMaxHeight = tableScrollHeight.value >= Number(maxHeight)
if (reachMaxHeight) {
return {
maxHeight: `${
tableScrollHeight.value -
headerScrollHeight.value -
footerScrollHeight.value
}px`,
}
return {
maxHeight: `${
props.maxHeight -
headerScrollHeight.value -
footerScrollHeight.value
}px`,
}
} else {
return {
Expand Down

0 comments on commit 015ac09

Please sign in to comment.