Skip to content

Commit

Permalink
Fix height and width set on ui table
Browse files Browse the repository at this point in the history
  • Loading branch information
mattrunyon committed Oct 16, 2024
1 parent 0b4eb5c commit a19e7f3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions plugins/ui/src/js/src/elements/UITable/UITable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,14 @@ export function UITable({
paddingX: marginX,
paddingY: marginY,
...restStyleProps,
// Add min and max height if the user set height or width explicitly
// This fixes issues in flex boxes where one table is auto sized and the other explicit
// The explicit table will never reach its size because the auto sized table has width/height 100%
// We don't want to set flex-shrink because it could be the cross-axis value that is explicitly set
minHeight: restStyleProps.minHeight ?? restStyleProps.height,
maxHeight: restStyleProps.maxHeight ?? restStyleProps.height,
minWidth: restStyleProps.minWidth ?? restStyleProps.width,
maxWidth: restStyleProps.maxWidth ?? restStyleProps.width,
},
viewStyleProps // Needed so spectrum applies styles from view instead of base which doesn't have padding
);
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit a19e7f3

Please sign in to comment.