Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a fix for elements overflowing the grid #44

Merged
merged 1 commit into from
May 5, 2016
Merged

Conversation

simonsmith
Copy link
Member

@simonsmith simonsmith commented May 3, 2016

Flex items have a min-width set to auto as per the spec:
https://www.w3.org/TR/css-flexbox/#min-size-auto

This causes elements like pre to extend past the Grid-cell even when
overflow is set.

Setting min-width to 0 fixes this and gives a more expected
behaviour in that situation.

Bug example: http://codepen.io/simonsmith/pen/BKGKBo
More detail: http://weblog.west-wind.com/posts/2016/Feb/15/Flexbox-Containers-PRE-tags-and-managing-Overflow

Have tested in several browsers and seems to work as expected

@jessehart
Copy link

dude, thank you. this bug was totally confusing me. much nicer than using overflow: hidden on the grid cell when these cases arise.

@@ -103,11 +103,14 @@
* utility or a component class that extends 'Grid'.
*
* 1. Set flex items to full width by default
* 2. Fix issue where elements with overflow extend past the
* `Grid-cell` container.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe you can create a git.io shorturl and add it here?

@giuseppeg
Copy link
Member

:shipit:
Is there an issue for this on Philip Walton's repo?

@simonsmith
Copy link
Member Author

There is not. Perhaps I should open one. I thought the commit message was quite detailed. Perhaps I could include a link to it or this PR?

@giuseppeg
Copy link
Member

Yeah that'd would do it too - it'd give people more context.
I like this idea http://rauchg.com/2016/addressable-errors

@simonsmith
Copy link
Member Author

@giuseppeg Good idea, done. I'll look at opening an issue on flexbugs too.

Flex items have a min-width set to `auto` as per the spec:
https://www.w3.org/TR/css-flexbox/#min-size-auto

This causes elements like `pre` to extend past the `Grid-cell` even when
overflow is set.

Setting `min-width` to `0` fixes this and gives a more expected
behaviour in that situation.

Bug example: http://codepen.io/simonsmith/pen/BKGKBo
More detail: http://weblog.west-wind.com/posts/2016/Feb/15/Flexbox-Containers-PRE-tags-and-managing-Overflow
@simonsmith simonsmith merged commit a288a60 into master May 5, 2016
@simonsmith simonsmith deleted the min-width-fix branch May 5, 2016 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants