Skip to content

Commit

Permalink
using app.tsx experiment
Browse files Browse the repository at this point in the history
  • Loading branch information
mbondyra committed Nov 28, 2024
1 parent b68b89d commit 605c841
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
11 changes: 10 additions & 1 deletion examples/grid_example/public/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,16 @@ export const GridExample = ({ coreStart }: { coreStart: CoreStart }) => {
defaultMessage: 'Grid Layout Example',
})}
/>
<EuiPageTemplate.Section color="subdued">
<EuiPageTemplate.Section
color="subdued"
contentProps={
expandedPanelId
? {
css: { display: 'flex', flexFlow: 'column nowrap', flexGrow: 1 },
}
: undefined
}
>
<EuiCallOut
title={i18n.translate('examples.gridExample.sessionStorageCallout', {
defaultMessage:
Expand Down
8 changes: 2 additions & 6 deletions packages/kbn-grid-layout/grid/grid_height_smoother.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,11 @@ export const GridHeightSmoother = ({
if (!smoothHeightRef.current) return;

if (expandedPanelId) {
const smoothHeightRefY =
smoothHeightRef.current.getBoundingClientRect().y + document.documentElement.scrollTop;
const gutterSize = parseFloat(euiThemeVars.euiSizeL);

// When panel is expanded, ensure the page occupies the full viewport height:
smoothHeightRef.current.style.height = `calc(100vh - ${smoothHeightRefY + gutterSize}px)`;
smoothHeightRef.current.style.transition = 'none';
smoothHeightRef.current.style.height = `100%`;
} else {
smoothHeightRef.current.style.transition = '';
smoothHeightRef.current.style.height = ``;
}
}
);
Expand Down

0 comments on commit 605c841

Please sign in to comment.