Fix chart panel auto-open

This commit is contained in:
Thomas Nordquist
2019-06-17 19:08:40 +02:00
parent 181575f71f
commit 06ab52bb6b
2 changed files with 5 additions and 3 deletions

View File

@@ -73,7 +73,7 @@ function ChartPanel(props: Props) {
)) ))
return ( return (
<div style={{ width: '100%', height: '100%', padding: '8px' }}> <div style={{ width: '100%', height: '100%', padding: '8px', flex: 1, overflow: 'hidden scroll' }}>
<Grid container spacing={1}> <Grid container spacing={1}>
<TransitionGroup component={null} className="example"> <TransitionGroup component={null} className="example">
{charts} {charts}

View File

@@ -46,7 +46,7 @@ function ContentView(props: Props) {
allowResize={true} allowResize={true}
style={{ height: 'calc(100vh - 64px)' }} style={{ height: 'calc(100vh - 64px)' }}
pane1Style={{ maxHeight: '100%' }} pane1Style={{ maxHeight: '100%' }}
pane2Style={{ borderTop: '1px solid #999', overflow: 'hidden scroll' }} pane2Style={{ borderTop: '1px solid #999', display: 'flex' }}
onChange={setHeight} onChange={setHeight}
> >
<span> <span>
@@ -68,7 +68,9 @@ function ContentView(props: Props) {
</div> </div>
</ReactSplitPane> </ReactSplitPane>
</span> </span>
<div> {/** Passing height constraints via flex options down */}
<div style={{ flex: 1, display: 'flex', height: '100%' }}>
{/** Resize detector must not be in the scroll zone, it needs to detect actual available size */}
<ReactResizeDetector handleHeight={true} onResize={detectSize} /> <ReactResizeDetector handleHeight={true} onResize={detectSize} />
<ChartPanel /> <ChartPanel />
</div> </div>