I have this situation where I have to make one of the flex-item in a flex container take up all available space of parent (the flex container). Therefore, I moved other flex-items out of DOM by setting position to "absolute".
<div style="display:flex; flex-direction:column">
<div style="flex:1 1 auto">Flex Item which should take it all...</div>
<div style="position:absolute">Not really a Flex Item 1</div>
<div style="position:absolute">Not really a Flex Item 1</div>
<div style="position:absolute">Not really a Flex Item 2</div>
</div>
<div style="display:flex; flex-direction:column">
<div style="flex:1 1 auto">Flex Item which should take it all...</div>
<div style="position:absolute">
<div>Not really a Flex Item 1</div>
<div>Not really a Flex Item 1</div>
<div>Not really a Flex Item 2</div>
</div>
</div>
display:none
position: absolute
If you can use height: 0
or width: 0
, you can hide the pop-ups without position: absolute
, display: none
or removing them from the container.