Skip to content
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

[iOS] Fix semi-transparent backgrounds on Text components #23872

Closed
wants to merge 13 commits into from
5 changes: 5 additions & 0 deletions Libraries/Text/Text/RCTTextShadowView.m
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ - (instancetype)initWithBridge:(RCTBridge *)bridge
return self;
}

-(void)didSetProps:(NSArray<NSString*>*)changedProps {
[super didSetProps:changedProps];
self.textAttributes.backgroundColor = nil;
}

- (BOOL)isYogaLeafNode
{
return YES;
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions RNTester/js/TextExample.ios.js
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,17 @@ exports.examples = [
return <Text>{'test🙃'.substring(0, 5)}</Text>;
},
},
{
title: 'Transparent Background Color',
render: function() {
return (
<Text style={{backgroundColor: '#00000020', padding: 10}}>
Text in a gray box!
<Text style={{backgroundColor: 'red'}}> another text in red box</Text>
</Text>
);
},
},
{
title: 'Text metrics',
render: function() {
Expand Down