I have a react component like so:
export default class DocumentSearch extends React.Component {
constructor() {
super();
this.state = {
numberOfResults: 270,
timeTakenForResults: 1
};
};
render() {
return (
<div>
<SearchBar top="true" />
<Tabs page="document" />
<p className="telemetry">
{`${this.state.numberOfResults} results (${this.state.timeTakenForResults} seconds)`}
</p>
<div className="document-results-background">
<div className="document-results-container" >
<Result url="https://example.com" title="Example Domain" description="undefined" />
<Result url="https://example.com" title="Example Domain" description="undefined" />
<Result url="https://example.com" title="Example Domain" description="undefined" />
<Result url="https://example.com" title="Example Domain" description="undefined" />
<Result url="https://example.com" title="Example Domain" description="undefined" />
<Result url="https://example.com" title="Example Domain" description="undefined" />
<Result url="https://example.com" title="Example Domain" description="undefined" />
<Result url="https://example.com" title="Example Domain" description="undefined" />
<Result url="https://example.com" title="Example Domain" description="undefined" />
<Result url="https://example.com" title="Example Domain" description="undefined" />
{/* <Pagination page="1" numberOfResults={this.state.numberOfResults} /> */}
</div>
</div>
</div>
);
};
};
Where "Result" is a div with some content, and has height and padding.
And the relevant css file for this component is as follows:
.document-results-background {
position: absolute;
width: 60vw;
top: 0;
left: 20vw;
min-height: 100vh;
background-color: lightgrey;
}
.document-results-container {
position: absolute;
top: 7.75vw;
width: 100%;
height: calc(100% - 7.75vw);
}
For some reason, when I place a lot of Result components, the height of "document-results-background" stays the same. Why might that be, even when the content is obviously greater that 100vh? I tried setting the height of .document-results-background to auto, but that just set its height to 0. So the browser thinks my content's height is 0, is this the reason for my issues, if so how do I fix it?