Open BrianHicks opened 7 years ago
As you brought up in the slack(and as a note for myself), this can be fixed if there is an intermediate div
between two elements that have display: flex
quite! For the sake of capturing here, this is what I have in my code now:
{-| IE11 doesn't like it when you nest elements with `display: flex` (it breaks text
flowing.) The solution here is to wrap elements that need reflowing _and_
nesting in a separate element with `display: block`. It's a bit silly but it works.
-}
ie11fix : style -> Element style variation msg -> Element style variation msg
ie11fix none child =
el none [] child
The SSCCE would be modified like so:
main =
viewport styleSheet <|
column None
[ padding 10 ]
[ ie11fix None <| column None -- TADA!
[ center
, width (px 400)
]
[ text "Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus." ]
]
Looks like using layout elements like
row
andcolumn
makes nested elements withdisplay: flex
. This breaks IE11. Silly IE. Here's the thread I found that explains this: https://stackoverflow.com/questions/23978986/flexbox-wrap-flex-items-in-ie11-brokenAnd an SSCCE (well not mininal, but enough to demonstrate the problem.) If I change the innermost
column
toel
things magically work.This renders in IE11 like so: