Skip to content

Commit a563c03

Browse files
ihgrantIan GrantsnowystingerLFDanLu
authored
add css rule to keep header visible when maxHeight is set (#3166)
* add css rule to keep header visible when maxHeight is set * add css rule to keep header visible when maxHeight is set * undo change in requestAnimationFrame mock Co-authored-by: Ian Grant <[email protected]> Co-authored-by: Robert Snow <[email protected]> Co-authored-by: Daniel Lu <[email protected]>
1 parent 26990c2 commit a563c03

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

packages/@adobe/spectrum-css-temp/components/table/index.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ svg.spectrum-Table-sortedIcon {
4444
border-left-style: solid;
4545
border-right-width: 1px;
4646
border-right-style: solid;
47+
flex: 0 0 auto;
4748
}
4849
.spectrum-Table-headCellContents {
4950
display: inline-block;

packages/@react-spectrum/table/chromatic/TableView.chromatic.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,17 @@ export const NestedColumns = Template().bind({});
198198
NestedColumns.storyName = 'nested columns';
199199
NestedColumns.args = {columns: nestedColumns, items};
200200

201+
export const MaxHeight = () => (
202+
<TableView maxHeight="size-1200">
203+
<TableHeader columns={columns}>
204+
{(column: any) => <Column key={column.key}>{column.name}</Column>}
205+
</TableHeader>
206+
<TableBody items={items}>
207+
{(item: any) => <Row key={item.foo}>{key => <Cell>{item[key]}</Cell>}</Row>}
208+
</TableBody>
209+
</TableView>
210+
);
211+
201212
export const Empty = EmptyTemplate().bind({});
202213
Empty.storyName = 'empty table';
203214
Empty.args = {};

0 commit comments

Comments
 (0)