I'm encountering an issue with a Grid container that contains 2 Grid items. The height of the second Grid item exceeds the height of the container, causing a scroll bar to appear.
Below is the code snippet for reference:
function App() {
return (
<Grid container style={{height: '100%'}}>
<Grid item xs={12} style={{border: 'solid 1px'}}>
Header
</Grid>
<Grid item xs={12} style={{height: '100%', border: 'solid 1px'}}>
Content
</Grid>
</Grid>
)
}
Visit this link for a live demo.
My question is, how can I ensure that the second Grid item fills the remaining height of its container without exceeding it? What am I missing in my code?
Any suggestions would be greatly appreciated. Thank you!