Skip to content
This repository has been archived by the owner on Jan 19, 2024. It is now read-only.

Layout issues when overriding justify-content #22

Open
nickiaconis opened this issue Mar 12, 2015 · 6 comments
Open

Layout issues when overriding justify-content #22

nickiaconis opened this issue Mar 12, 2015 · 6 comments

Comments

@nickiaconis
Copy link

There is a bug in at least Chrome 40.0.2214.115 (64-bit) in which a style that overrides a previously styled justify-content property causes unexpected layout. The same styling produces the expected result in at least Firefox 36.

Here is an demonstration using media queries to trigger the styling: http://codepen.io/niaconis/pen/VYExLe

Here is a work around (at least when using media queries): http://codepen.io/niaconis/pen/MYPGWq

@gregwhitworth
Copy link
Collaborator

That's a good one, have you opened a bug against Blink? Interestingly, if it's within the same declaration it works as expected: http://codepen.io/anon/pen/bNmjGV, seems like it's failing to look up the correct layout node to store the new value; which seems odd because you'd think this was using all of the same code so it would break on all prop/val lookups for a new declaration. At any rate, I suggest opening a blink bug, but I do think we should provide this workaround.

@nickiaconis
Copy link
Author

It looks like there are already a few issues filed for this, at least the top three in a search for "justify-content" as of writing. Interesting discovery about the same declaration.

@nickiaconis
Copy link
Author

Also, here's another workaround that I found on a comment to one of those Blink tickets: http://codepen.io/niaconis/pen/ByqPeW
If the desired override is justify-content: flex-start;, which does not work, then justify-content: initial; may be used instead, which works.

@gregwhitworth
Copy link
Collaborator

Yeah, I messed around with initial a little bit at first to get the depth of Chrome's issue, but initial is not supported in IE unfortunately. So if we want a true cross browser solution then your first one is the way to go. That, or you can use @supports to check for initial support and apply the Chrome fix in there.

@philipwalton
Copy link
Owner

As far as I can tell, this only happens when using space-between or space-around. When I use center, flex-start, or flex-end, I get the expected results.

@ob7
Copy link

ob7 commented Apr 16, 2015

Same issue here. Trying to find a way to override a center with space-between and its like you have both applied. I need to remove center manually somehow...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants