My example, rest of code is same:
Code: Select all
return (
<div style={{ width: '100%', height: '100%', overflow: 'auto', position: 'fixed' }}>
<TabView>
<TabPanel header='HEADER I'>
<div style={{ backgroundColor: 'cyan' }}>Rest</div>
</TabPanel>
</TabView>
</div>
);
CSS for expanding TabView:
Code: Select all
.p-tabview {
height: 100%;
display: flex;
flex-direction: column;
}
.p-tabview-panels {
flex-grow: 10;
}
And that's it. If you really want to expand internal DIV element (one with cyan color) you have to add:
Code: Select all
.p-tabview-panels div {
height: 100%;
}
But I don't recommend this because this DIV really has height of viewport and when you add another div bellow cyan it will start after it. Try to replace TabPanel code with following snippet and you will see yourself why:
Code: Select all
...
<TabPanel header='HEADER I'>
<div style={{ backgroundColor: 'cyan' }}>
<h1>Rest1</h1>
</div>
<div style={{ backgroundColor: 'lightgreen' }}>
<h1>Rest2</h1>
</div>
</TabPanel>
...