I'm learning Flexbox layout right now after having to take over a project after someone abandoned it and have run into a bug where flex-item images don't seem to scale their height at all w/ responsive design. Width scales fine, but the height never scales and remains fixed at original height.
I have a very simple set up of something like:
<div class="my-container">
<img src="..." />
<img src="..." />
<img src="..." />
</div>
CSS is very basic:
.my-container {
display: flex;
flex-direction: column;
flex-wrap: wrap;
justify-content: space-between;
}
.my-container img {
display: block;
flex-grow: 1;
flex-shrink: 1;
flex-basis: auto;
max-width: 100%;
}
Basically, a single column (the mobile view - iphone). The above works and looks great in Firefox. On Chrome (v 48.0) the image height is NOT scaling.
E.g. the 1st <img>
is a 940px x 500px wide image which looks great on Desktop, but in Chrome it is 300px x 500px. Width is scaling but height is not? The 2nd and 3rd images ~460px and appear on a row next to each other.
Oddly, if I make flex-direction: row, then Chrome renders correctly and the image height appears to scale, but Firefox then breaks and has the same issue!
Am I out to lunch here?
Thankfully, everything RENDERS OKAY on mobile devices. This only seems to occur when resizing your browser window. :/