-
Notifications
You must be signed in to change notification settings - Fork 80
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
Background issue with React native 0.61-rc3 #117
Comments
If you attach a screenshot, I can be more certain what the issue is. But I'm guessing it's to do with the When you write The |
I'll need to see both screenshots 😄 Did changing flex not work? Try playing around with that a bit. I'm not totally sure what you're trying to do, so I can't really give pointers here |
Thanks for those screenshots. So am I right in thinking the layout is correct, but the order is wrong. Does adding some z-indices fix it? |
Nothing at all for the background :( |
Strange. One thing to try is if you put in the styles you're using through css-to-react-native, and copy the output into your demo. Then you'd be able to narrow down whether it's the styles this library generates or something else. |
I tried to update the app I'm working on to 0.61.0, and I'm seeing the same thing: the styles are messed up on Android, but not iOS. I'm using CSS modules instead of styled components. |
I found this from facebook/react-native#26544
Looks like a serious React Native bug |
Thanks for finding that — @Trobyss could you see if removing the border radius fixes the issue? |
I created a new 0.61 project and I'm trying to the examples from @Trobyss, but I'm not seeing the bug on Android using those examples. |
@kristerkari i don't know if it helps, but i'm facing strange behaviour only on Android API Level 26 |
I tried on two emulators with API 26, but still could not reproduce the bug with the examples from this thread. Maybe someone else could try to do the same thing and see if the bug can be reproduced? I know that there is something broken with 0.61 because I saw styles being broken on Android in the other project that I updated from 0.60 to 0.61. |
Removing border-radius seems to fix the issue for this example 👍 Looks like this is the true problem const Bug = () => {
return (
<View style={{ flex: 1 }}>
<BuggingView />
<PageWrapper>
<Text>
This should appear above backgroundThis should appear above background This should appear above background This should appear
above above background This should appear above background This should appear above background This should appear above background
This This should appear above background This should appear above background This should appear above background This should
appear above background This should appear above background This should appear above background This should appear above
background This should appear above background This should appear above background This should appear above background This should
appear above background This should appear above background This should appear above background This should appear above
background This should appear above background This should appear above background This should appear above background This should
appear above background This should appear above background This should appear above background This should appear above
background This should appear above background
</Text>
</PageWrapper>
</View>
);
};
const BuggingView = styled.View`
height: 200;
position: absolute;
background-color: blue;
top: 0;
right: 0;
left: 0;
`;
const PageWrapper = styled.View`
background-color: red;
padding: 20px;
/* border-radius: 8px; */
flex: 1;
margin: 20px;
`; |
I'm going to close this issue, but you're free to continue the discussion here if you wish |
Hello
After investigating with @Trobyss we found an issue with styled-components after migrating on 0.61-rc3 to test on ANDROID.
You can freely switch between
Bug
andBuggingView
to see the difference.The text is correctly displaying above the background in absolute, but not the background of the text container.
Without styled-components, this works.
Any idea what would cause that ? as you can see this works with latest expo version : https://snack.expo.io/@afigueiredo/1fe053
Best regards
The text was updated successfully, but these errors were encountered: