-
Notifications
You must be signed in to change notification settings - Fork 24.3k
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
Using absolute positioning, when the parent element has padding, the width height of the current element is incorrectly laid out using a percentage layout #46392
Comments
|
|
I just closed the new architecture with 0.75.2 and got the same result, which cannot occupy all the height. However, in the previous version, I used 0.71, which was consistent with web performance at that time |
hello |
yes |
Can you guide me through the file structure of this project? In this directory will i find the app.js file and its other pages? |
is it available inside the helloworld directory? |
<View
style={{
backgroundColor: '#000',
height: 300,
paddingTop: 200,
paddingLeft: 200
}}>
<View style={{
position: 'absolute',
// width height 100%会排除父元素的padding
width: '100%', height: '100%', left: 0, top: 0,
backgroundColor: '#666'
}} />
</View> |
@ShaoGongBra this doesn't look New Architecture related (at least from your reproducer), right? Like the same behavior happens on both Old and New Architecture |
yes |
Description
In the new architecture, I set the height to 100%, but its height is not equal to the height of the parent container, but will subtract the padding of the parent container
Steps to reproduce
1
React Native Version
0.75.2
Affected Platforms
Runtime - Android, Runtime - iOS
Areas
Fabric - The New Renderer
Output of
npx react-native info
Stacktrace or Logs
Reproducer
https://github.com/ShaoGongBra/rn-test
Screenshots and Videos
No response
The text was updated successfully, but these errors were encountered: