Skip to content

Commit 8e7ffc5

Browse files
committed
fix(LayoutContent): auto-height layout
1 parent eacf037 commit 8e7ffc5

File tree

4 files changed

+11
-8
lines changed

4 files changed

+11
-8
lines changed

src/components/content/Layout/Layout.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ export const MultiplePanels: Story = {
429429

430430
export const HorizontalScrollableContent: Story = {
431431
render: () => (
432-
<Space width="500px" height="(5x - 2bw)">
432+
<Space width="500px" gap="0">
433433
<Layout.Block fill="#light" placeSelf="center">
434434
Fixed Left
435435
</Layout.Block>

src/components/content/Layout/Layout.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ describe('Layout.Panel resize handler', () => {
327327
describe('Layout.Panel validation', () => {
328328
beforeEach(() => {
329329
// Suppress console.error for expected errors
330-
jest.spyOn(console, 'error').mockImplementation(() => { });
330+
jest.spyOn(console, 'error').mockImplementation(() => {});
331331
});
332332

333333
afterEach(() => {

src/components/content/Layout/LayoutContent.tsx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,23 @@ const ContentElement = tasty({
1919
qa: 'LayoutContent',
2020
styles: {
2121
position: 'relative',
22-
display: 'block',
22+
display: 'grid',
23+
gridColumns: '1sf',
24+
gridRows: '1sf',
25+
placeContent: 'stretch',
26+
placeItems: 'stretch',
27+
placeSelf: 'stretch',
2328
flexGrow: 1,
24-
minHeight: 0,
29+
height: 'min 0',
2530
overflow: 'hidden',
2631
boxSizing: 'border-box',
27-
placeSelf: 'stretch',
2832

2933
Inner: {
30-
position: 'absolute',
31-
inset: 0,
3234
display: 'flex',
3335
flow: 'column',
3436
padding: '($content-padding, 1x)',
3537
overflow: 'auto',
38+
placeSelf: 'stretch',
3639
scrollbar: {
3740
'': 'thin',
3841
'scrollbar=tiny | scrollbar=none': 'none',

src/components/content/Layout/LayoutPanelHeader.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const PanelHeaderElement = tasty(Item, {
2626

2727
export interface CubeLayoutPanelHeaderProps
2828
extends BaseProps,
29-
ContainerStyleProps {
29+
ContainerStyleProps {
3030
/** Panel title */
3131
title?: ReactNode;
3232
/** Title heading level (affects semantics, not visual) */

0 commit comments

Comments
 (0)