Incorrect width calculations when using margin with align-items: 'stretch' #1788
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Description
When using a View with
margin
inside a parent View that hasalignItems: 'stretch'
, the child's width is incorrectly calculated. The margin appears to be subtracted multiple times from the available width, making the child View significantly narrower than expected.Expected behaviour
Given a parent View of width 400 and a child View with
margin: 20
:360
(parent width - margin * 2)Steps to reproduce
React Native Version
0.77.1
Affected Platforms
Runtime - iOS
Output of
npx @react-native-community/cli info
Stacktrace or Logs
Reproducer
https://github.com/LJNGDAHL/layout-bug
Screenshots and Videos
Hello @LJNGDAHL and thanks for reporting this problem, does it happen on Android too?
cc @NickGerleman
@migueldaipre: thanks for the quick response! Yes, it is happening on Android as well.
Any progress on this one? 👂