react icon indicating copy to clipboard operation
react copied to clipboard

PageLayout doesn't extend the sidebar divider when extending the height.

Open maximedegreve opened this issue 1 year ago • 5 comments

Description

On GitHub, I've seen some pages using the PageLayout component, but there's a problem: when you can't scroll, the PageLayout doesn't stretch to fill the whole page, which means the divider ends up getting cut off halfway down the page. To fix this, I tried making the PageLayout fill up all the available space from its parent in a few instances, but this didn't solve the issue – the divider still gets cut off.

Code snippet showing the divider line not expanding

šŸ’¬ Related internal conversation

Steps to reproduce

Check my CodeSandbox

Version

Latest

Browser

Safari

maximedegreve avatar Mar 04 '24 22:03 maximedegreve

Hi! This issue has been marked as stale because it has been open with no activity for 180 days. You can comment on the issue or remove the stale label to keep it open. If you do nothing, this issue will be closed in 7 days.

github-actions[bot] avatar Sep 10 '24 16:09 github-actions[bot]

I could fix your issue by adding height: '100vh' in line 46 of your code.

CleverLemming1337 avatar Oct 04 '24 15:10 CleverLemming1337

The PageLayout component is not opinionated about layout and was underspecified in the CodePen. By adjusting the following props, it will fill its parent, and the divider will extend as expected:

image showing UI fix when props specified

<PageLayout
  sx={{
    bg: 'green',
    flex: 1, // Fills available space in the parent
    display: 'flex', // Makes PageLayout a flex container
    flexDirection: 'row', // Aligns children horizontally
  }}
/>

Looks like this was a layout misunderstanding rather than a bug. I’d suggest closing the issue.

dwsosa avatar Apr 23 '25 23:04 dwsosa

I have a PR with this as the default behavior if that approach is preferred.

dwsosa avatar Apr 24 '25 19:04 dwsosa

@maximedegreve Would you be ok if we just updated the documentation of the component? I believe this would be the best approach here

hectahertz avatar May 16 '25 17:05 hectahertz

Hey @maximedegreve šŸ‘‹šŸ» Any opinion here? We are proposing to update the component documentation to help explain this.

lesliecdubs avatar Jul 07 '25 15:07 lesliecdubs

Yes. Sounds good to me.

maximedegreve avatar Jul 15 '25 13:07 maximedegreve

Sorry that this issue is bouncing around. But we should triage this as an size small issue and update the documentation as suggested.

pksjce avatar Oct 17 '25 07:10 pksjce