-
Notifications
You must be signed in to change notification settings - Fork 1.2k
[Stack] Fix min-width issue on Stack.Item #2273
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
Conversation
21cff9e to
afabb30
Compare
|
Looks like in some case this is touching the edge. On Percy, but also on ios. |
Yeah, that's interesting. It looks like that example is a little wonky though. It uses nested stacks to do something that should be handled by a |
|
|
||
| .Item { | ||
| flex: 0 1 auto; | ||
| min-width: 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When the stack width is smaller than the contents, the contents overflow each other. Maybe we could make them wrap to the next line? Not sure if this would introduce even more edge cases though
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because this is an abstraction of Flexbox we might just want to leave it as is. Wrapping is left up to the props which should generate the right flexbox rules.
|
There's still some weirdness happening with this when white space nowrap is set on a children. Overall I think this is better than we have today since the column is not showing up at all. I'm thinking if you are happy with the top hat Dom, we ship this for now. |
dfmcphee
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is the better option of the two. 🚢
WHY are these changes introduced?
In fixing this issue #1707 we removed min-width thinking it wasn't needed. Turns out it is.
fixes: #2260
WHAT is this pull request doing?
Simply bringing back the min-width so that the flex-items takes the space it requires.
We do still have an issue where if
textOverflow: 'ellipsis',is used on the child of the flex item, overflow is a little off. In which case its probably best to write flexbox for this edge case.This fixed the bigger issue of the column not appearing.
How to 🎩
🖥 Local development instructions
🗒 General tophatting guidelines
📄 Changelog guidelines
Copy-paste this code in
playground/Playground.tsx:🎩 checklist
README.mdwith documentation changes