Bug: inner view with `flex: 1` collapses its size to 0
See original GitHub issueDescribe the bug
When flex: 1
is added to an inner view inside the carousel, its size will be collapsed to 0.
To Reproduce
Repro in https://github.com/dohooo/react-native-reanimated-carousel/pull/211
Expected behavior
Size should not collapse, or docs should reflect to not use flex: 1
.
Screenshots
With flex: 1
:
Without flex: 1
:
Versions (please complete the following information):
This bug is visible in current master
. See repro in #211
Issue Analytics
- State:
- Created a year ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
When flexbox items wrap in column mode, container does not ...
Just a sidenote, but there's a bug in Chrome that causes a container with it's flow set to column wrap not to expand...
Read more >`flex: 0` does not respect intrinsic size on Web; but ... - GitHub
When flex is -1, the component is normally sized according to width and height . However, if there's not enough space, the component...
Read more >Flex-basis not respected when intrinsically sizing nested flex ...
What happens in Firefox currently is ".horizontal-container-shrink" is behaving as if it has flex: 1 1 auto; forcing its parent ".horizontal-container > li: ......
Read more >`flex-grow` is weird. Or is it? | CSS-Tricks
If the width of each element is 0, the remaining space equals the actual width of the parent element and thus it looks...
Read more >Collapse - Bootstrap
Collapsing an element will animate the height from it's current value to 0 . Given how CSS handles animations, you cannot use padding...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Using the same layout implementation and works fine.
flex: 1
insteadflexGrow:1
works fine. but this is a related behavior with the element inside and not the Carousel itself and can be solved modifying thedisplay
attribute of the item container.Could you provide a minimal reproduction?