-
Notifications
You must be signed in to change notification settings - Fork 496
IE 11 - image resizing bug? #75
Comments
I think this is definitely a bug. What's interesting is it only seems to happen with a nested flexbox. If you comment out the flex declaration on the wrapper element, it renders correctly. Have you found a workaround? I think there's a whole class of IE-related bugs that result from nested flexboxes, but I haven't found enough commonalities or generalized workarounds to be able to properly document them. |
I don't think I found a workaround yet (other than, like, using consistently sized images so at least I don't wind up with random bursts of excessive whitespace) but I'll be looking at my use cases again in the next week or so. |
Possible workaround: applying a 1px min-height to the body div in the above example collapses the div as I'd expect it to. http://codepen.io/darby3/pen/VLoExv?editors=110 Kind of a shot in the dark, I stole the min-height idea from something else and tried it on a whim~~, but now I can't remember where I saw it/used it.~~; I have it applied to some form input elements in another project (for some reason that must have made sense at the time but which I didn't document).. |
Hmmm, it's very strange why |
"Why" is a bit over my head. I can also say I just used a min-width:1px to make form inputs in Firefox respect a flex-basis percentage. It's all a bit magic pixie dust to me but I'd love to know if someone can explain what's going on here. |
I just finished dealing with this bug. It's terrible and unintuitive. Here's a stripped-down code example that describes and replicates the bug in IE10 and IE11: Thanks @darby3 for putting up this workaround. I've been beating myself up over this stupid bug for a few days now, and never would have thought of min-height. |
the problem is that while the immediate flexbox parent can be fixed like that. embedding the example into the sticky footer for example will still make the site-content use the effective image height and not the resized calculated image height. |
@ScottTrenda thank you so much! fixed my issues. |
@ScottTrenda Thanks from 2017. |
@ScottTrenda Thanks from 2018. |
This is a bug reported to Microsoft (I can't find the link now!). As it's for IE it's marked as a nofix, but with the above workaround in a comment as a solution. |
@ScottTrenda Thanks from 2019! (wanted to be first) |
@ScottTrenda Thank you so much. I've spent a lot of hours trying to solve that problem. Thank you!! |
Another "Thank You!" from me. I was going crazy about this one. |
As @rtack mentioned, the min-height trick doesn't work when the flexbox grid is inside of another flexbox grid, like the Holy Grail Layout. Here's my example philipwalton/solved-by-flexbox#114. Seems like there isn't a workaround for this case... |
Thank you from 2018! |
Thanks from 2372. |
@Jip-Hop |
Thank you @darby3 and @ScottTrenda. You have made my day! |
Thank you, @darby3 and @ScottTrenda! The two of you managed to save me from hours of frustration figuring out why this wasn't working. It's a shame that this isn't in the Flexbugs page properly. FWIW, this issue is quite high up on the google search for "ie11 flexbox image size bug". It would be good if people were directed to the proper Flexbugs page than this issue, but I understand that it's due to lack of documentation. Anyway, thanks for this. 😄 |
Hi everyone I go through all of the discussion it's a very good discussion but doing what you guys figure out still remain the height of the card same and the space is created between the image and the text |
I've got to the point that that I've set the max-width for the image inside the flex-item that would not affect height and would not affect the image resizing. The layout I need to have is: The small boxes won't grow much until it reach mobile size and it would need some css changes to adjust for a stacked mobile display. -FlexBox |
happened for me today with bootstrap4 and an image inside .modal-body min-height: 1px; on .modal-body fixed it.
|
THANKS! 🙏 🙏 🙏 |
Thanks from 2019. :) |
Thanks a lot, @darby3 and @ScottTrenda!
This also works with |
@ScottTrenda Thanks, worked perfectly for UIkit 3.0.3 |
Another thank you @ScottTrenda from me. This bug nearly drove me crazy today, and I'm sure it's kicked me up the behind a few times before today as well. 🙏🙏🙏 |
I cannot imagine that it is still a workaround in 2019... Thank you very much! |
That's what happens when development stops on an old browser version. |
Thanks from Sep 2019! |
Thanks from 2020. :) |
this saved me today! thanks many times. |
Thanks from March 2020. Saved me a lot of headache. |
Thanks from March 2020 as well! |
👀 |
Thanks from April 2020..!! |
Thanks from July 2020! |
Thanks from Aug 2020! |
I'll continue the custom 😸: Thanks from October 2020! ..just ridiculous we are still dealing with this browser |
how on hell could someone come up with such workaround?! ;) |
The min-height fix doesn't necessarily have to be applied to the flexboxes. In my case I had a few layers of elements between the |
@ScottTrenda thanks from 2021 because we are still using IE11 🙇🏻♂️ |
Thanks from September 2021! |
So, I'm resizing an image to fill the width of a flex div. In Chrome, this works like I would expect it to: the image fills the div by width and auto's the height proportionally. In IE 11, though, it appears to size the image correctly, but the surrounding body div sizes up its height (never collapses) as if the full height of the source image were there.
http://codepen.io/darby3/pen/waZRme?editors=110
IE 11 bug? Or am I doing something wrong?
The text was updated successfully, but these errors were encountered: