Skip to content

Commit 044843b

Browse files
georgylobkojperals
andauthored
fix: Set nested app layout height to 100% (#3100)
Co-authored-by: Joan Perals <[email protected]>
1 parent 6310aca commit 044843b

File tree

3 files changed

+25
-1
lines changed

3 files changed

+25
-1
lines changed

src/app-layout/__integ__/multi-app-layout.test.ts

+21
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,27 @@ describe.each(['classic', 'refresh', 'refresh-toolbar'] as Theme[])('%s', theme
5050
});
5151
})
5252
);
53+
54+
test(
55+
'secondary layout does not vertically overflow the primary one',
56+
setupTest(async page => {
57+
// Provide enough height for all page elements to fit without overflow
58+
const outerBrowserWindowHeight = 1400;
59+
await page.setWindowSize({ width: 1200, height: outerBrowserWindowHeight });
60+
61+
// Retrieve the actual viewport size, excluding browser UI
62+
const { height: innerViewportSize } = await page.getViewportSize();
63+
64+
const { bottom: mainLayoutBottom } = await page.getBoundingBox(mainLayout.toSelector());
65+
expect(mainLayoutBottom).toBeLessThanOrEqual(innerViewportSize);
66+
67+
await page.runInsideIframe(iframeId, !!iframe, async () => {
68+
const { bottom: secondaryLayoutBottom } = await page.getBoundingBox(secondaryLayout.toSelector());
69+
expect(secondaryLayoutBottom).toBeLessThanOrEqual(innerViewportSize);
70+
expect(secondaryLayoutBottom).toBeLessThanOrEqual(mainLayoutBottom);
71+
});
72+
})
73+
);
5374
});
5475
});
5576
});

src/app-layout/visual-refresh-toolbar/index.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -467,6 +467,7 @@ const AppLayoutVisualRefreshToolbar = React.forwardRef<AppLayoutProps.Ref, AppLa
467467
{!hasToolbar && breadcrumbs ? <ScreenreaderOnly>{breadcrumbs}</ScreenreaderOnly> : null}
468468
<SkeletonLayout
469469
ref={useMergeRefs(intersectionObserverRef, rootRef)}
470+
isNested={isNested}
470471
style={{
471472
paddingBlockEnd:
472473
splitPanelPosition === 'bottom'

src/app-layout/visual-refresh-toolbar/skeleton/index.tsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ interface SkeletonLayoutProps
4040
globalTools?: React.ReactNode;
4141
globalToolsOpen?: boolean;
4242
navigationAnimationDisabled?: boolean;
43+
isNested?: boolean;
4344
}
4445

4546
export const SkeletonLayout = React.forwardRef<HTMLDivElement, SkeletonLayoutProps>(
@@ -67,6 +68,7 @@ export const SkeletonLayout = React.forwardRef<HTMLDivElement, SkeletonLayoutPro
6768
disableContentPaddings,
6869
globalToolsOpen,
6970
navigationAnimationDisabled,
71+
isNested,
7072
},
7173
ref
7274
) => {
@@ -81,7 +83,7 @@ export const SkeletonLayout = React.forwardRef<HTMLDivElement, SkeletonLayoutPro
8183
[styles['has-adaptive-widths-dashboard']]: contentType === 'dashboard',
8284
})}
8385
style={{
84-
minBlockSize: `calc(100vh - ${placement.insetBlockStart + placement.insetBlockEnd}px)`,
86+
minBlockSize: isNested ? '100%' : `calc(100vh - ${placement.insetBlockStart + placement.insetBlockEnd}px)`,
8587
[customCssProps.maxContentWidth]: isMaxWidth ? '100%' : maxContentWidth ? `${maxContentWidth}px` : '',
8688
[customCssProps.navigationWidth]: `${navigationWidth}px`,
8789
[customCssProps.toolsWidth]: `${toolsWidth}px`,

0 commit comments

Comments
 (0)