I'm looking to make multiple scrolling columns using Material UI in React. I had a way of doing it in bootstrap with flex, but I can't get it to translate over. I have put together a demo of a hacky way to do it that requires knowing the size of the contents above what you're trying to scroll (in this case, the AppBar)
https://codesandbox.io/s/pmly895mm
html,
body {
margin: 0;
height: 100%;
}
#root {
height: 100%;
}
.grid-container {
height: calc(100% - 64px);
}
.grid-column {
height: 100%;
overflow-y: auto;
}
In this demo, I set all of the heights to 100% (html, body, #root) and then created two classes grid-container with a height of 100% - AppBar height and grid-column with a height of 100% and an overflow-y of auto.
In Bootstrap, I would apply these classes to the row and column elements respectively
.flex-section {
flex-grow: 1;
display: flex;
flex-direction: column;
min-height: 0;
}
.flex-col-scroll {
flex-grow: 1;
overflow: auto;
min-height: 100%;
}
And it wouldn't matter what was above the elements because flex took care of the heights.
Specifically, I am looking to avoid having to do height: calc(100% - 64px) as this requires me knowing the element heights beforehand. I'm going to have some pages where I'd like to put some content above the scrolling area that will have dynamically tall content.