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
Gap moves children views outside containing view #1653
Comments
|
This issue is present on latest patch |
I think this is no longer and issue on react-native |
@Mookiies is this something that no longer reproes in RN 0.74/Expo 51, or just doesn’t repro in latest Yoga playground? RN is opted into some older code wrt absolute positioning, so it’s possible they have different behavior. |
It looks to be solved on RN 0.74. I tried it out here and doesn't seem to happen anymore: https://github.com/Mookiies/absolute-repro/tree/master |
Description
If using
gap
,justifyContent
, and the first child is absolutely positioned, other children will be offset by thegap
value.This is unexpected because, the parent view should be containing the children, but it's not. Absolutely positioned children should not affect
gap
or the positioning of other views. Current behavior doesn't match CSS.Somewhat related to #1652
Steps to reproduce
gap
and a non-defaultjustifyContent
position: 'absolute
on the first childReact Native Version
0.73.7
Affected Platforms
Runtime - Android, Runtime - iOS
Output of
npx react-native info
Stacktrace or Logs
Reproducer
https://snack.expo.dev/@mookiies/gap-moving-child
Screenshots and Videos
Container has blue background and
gap
value of100
Pink square is first child
position: 'absolute
with dimensions 50x50Red square is second child with dimensions 100x100
justifyContent: 'center'
gap/2
justifyContent: 'flex-end'
justifyContent: 'flex-start'
Same behavior of gap affecting children persists with multiple children (2 children red squares)
justifyContent: 'center'
gap/2
justifyContent: 'flex-start'
Reproduction with web react: https://playcode.io/1850576
The text was updated successfully, but these errors were encountered: