-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
Text alpha broken in 0.57.2 on Android #21507
Comments
@kelset that was my first thought but gut feeling now is it could be b7ba225 (which would be a shame as that's a great method for overlaying text on images without a 'scrim'). I'm wondering if maybe a shadow with 0 radius is always displaying under the text even if one is not specified? I will try to get set up for building from source soon so I can be a bit more helpful in these situations 😄 |
ah nice catch, it could very well be! |
@kelset actually yeah, setting |
It seems like that commit causes text shadows to be enabled by default. (ReactBaseTextShadowNode.java#L261). Can't you disable them by setting |
@idk-whatever yep that works and is a much easier workaround, thanks 👍 |
Worth mentioning that all text now looks slightly bloated even without the alpha, I guess the shadow is peeking out around the edges slightly... |
Uhm understood - @yungsters should we consider reverting the cherry pick in 0.57.3? I feel like potentially the fix is easy so not sure which approach should be better 🤔 |
@kelsey One of our beloved release engineers at Facebook used to say… if you’re going to be around to fix it, do whatever you want. Let’s fix forward if the fix is easy. :) |
Any workarounds for this? For the moment, all texts are blurry in our app. |
@Batistleman you need to add Bit of a pain if you have a large app... For a slightly quicker way we ended up creating two new components, also called Text and Icon then in the render function for those is just render a RN Text or RNVI Icon with Off the top of my head something like this should work: // Text.js
import react from 'react';
import {Text} from 'react-native';
export default function Text(props) {
const {style} = props;
return <Text {...props} style={[{textShadowRadius: 0}, ...(Array.isArray(style) ? style : [style])]} />;
} |
"react-native": "0.57.3", |
Bumped into this as well. Temporary workaround is to put following snippet in the constructor of your main
This will put |
I think that this commit that landed 3 days ago may be the solution fd78eee Can anyone confirm that? I'll try to have it in 0.57.8. |
@kelset It's fixed for me in v0.57.8 |
Awesome :) closing :) |
Environment
Run
react-native info
in your terminal and paste its contents here.Description
Describe your issue in detail. Include screenshots if needed. If this is a regression, let us know.
This is a regression, previously text with colour containing an alpha value would be displayed correctly, now it looks (visually) like the alpha was blended on a dark or black background.
e.g. View with a blue background and rgba(255,255,255,0.2) text on it - the text would display as a light blue. Now it displays as a shade of dark grey (or lighter grey depending on alpha value).
Reproducible Demo
Let us know how to reproduce the issue. Include a code sample, share a project, or share an app that reproduces the issue using https://snack.expo.io/. Please follow the guidelines for providing a MCVE: https://stackoverflow.com/help/mcve
https://github.com/mjmasn/TextAlpha0571 (0.57.1 - working)
https://github.com/mjmasn/TextAlpha0572 (0.57.2 - broken)
The text was updated successfully, but these errors were encountered: