I am trying to draw a map in a flex child that takes up the remaining space.
I have a couple of headers on top of the main content, and one of the banners is sometimes hidden / deleted, so I use flexbox so that the header can go away without affecting the position of the other elements. I.E. This does not work when I use absolute positions.
My problem is that the booklet seems to calculate the map viewport before flexbox has calculated the height for the map div.
Example:
Here is a screenshot of the booklet in which the height of the cards is less than it should be.

If I check the height of the elements, this is correct. And, in addition, if I put a timer and made the sheet reject the size of the map, the map will be displayed again at the correct height.
HTML:
<body> <div class="header"> Header </div> <div class="banner"> Banner </div> <main class="main"> <div class="nav"> <strong>Navigation</strong> </div> <div id="map" class="map-content"></div> </main> <script src="script.js"></script> </body>
CSS
html, body { height: 100%; width: 100%; display: flex; flex-direction: column; } .header { height: 50px; background-color: grey; color: white; } .banner { height: 50px; background-color: lightgrey; color: white; } .main { display: flex; flex: 1 1 auto; flex-direction: row; } .map-content { flex: 1 1 auto; } .nav { background-color: #2A3D4A; color: white; width: 200px; }
EDIT:
I reproduced the problem in the plunger, cheers! However, I still do not know exactly what is happening. The problem occurs when I include ngAnimate in my application. It doesn't matter if I use ngAnimate or not.
Here is a broken plunger. When the page loads, the map is in order. Follow the link, then return to the map. Please note that when returning only about half the load on the card. I record the height on the console. When you move away from the card and return it about half the size.
What is angular animate to make an element be half in size within a second? Is this a bug in angular?
http://plnkr.co/edit/dyBH1Szo3lIEWajKqXWj?p=preview