Skip to content

Commit

Permalink
[0.64] Fix Text.Color not working with backgroundColor (#7794)
Browse files Browse the repository at this point in the history
* Fix Text.BackgroundColor overwriting foreground. (#7707)

* Change files

* reconcile treedump library calls

* Update snapshot.

Co-authored-by: Igor Klemenski <igklemen@microsoft.com>
  • Loading branch information
rectified95 and Igor Klemenski committed May 26, 2021
1 parent 8e8fc55 commit 440f694
Show file tree
Hide file tree
Showing 9 changed files with 328 additions and 30 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "Fix Text.BackgroundColor overwriting foreground. (#7707)",
"packageName": "react-native-windows",
"email": "igklemen@microsoft.com",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,40 @@ export function TextBackgroundColorTestPage() {
return (
<View>
<View testID={'TextColorBackgroundView'}>
<Text style={{color: 'pink'}}>Outer pink</Text>
<Text style={{}}>
Outer <Text style={{color: 'red'}}>red nested</Text>
</Text>
<Text style={{}}>
Outer{' '}
<Text style={{backgroundColor: 'blue', color: 'white'}}>
nested white on blue
</Text>
</Text>
<Text style={{color: 'pink'}}>
Outer pink <Text style={{color: 'red'}}>nested red</Text>
</Text>
<Text style={{backgroundColor: 'green'}}>
Outer on green{' '}
<Text style={{color: 'white'}}>nested white on inherit green</Text>
</Text>
<Text style={{backgroundColor: 'green', color: 'orange'}}>
Outer orange on green{' '}
<Text style={{backgroundColor: 'blue', color: 'white'}}>
nested white on blue
</Text>
</Text>
<Text style={{color: 'orange'}}>
Outer orange{' '}
<Text style={{backgroundColor: 'blue', color: 'white'}}>
nested white on blue
</Text>
</Text>
<Text style={{color: 'orange'}}>
<Text style={{backgroundColor: 'blue'}}>
nested orange inherit on blue
</Text>
</Text>
<Text>
Outer no_color{' '}
<Text style={{ backgroundColor: 'green' }}>
Expand Down Expand Up @@ -86,4 +120,4 @@ export const examples = [
return <TextBackgroundColorTestPage />;
},
},
];
];
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,48 @@ export class BackgroundColorDemo extends React.Component<{}> {
public render() {
return (
<View>
<Text style={{color: 'pink'}}>Outer pink</Text>
<Text style={{}}>
Outer <Text style={{color: 'red'}}>red nested</Text>
</Text>
<Text style={{}}>
Outer{' '}
<Text style={{backgroundColor: 'blue', color: 'white'}}>
nested white on blue
</Text>
</Text>
<Text style={{color: 'pink'}}>
Outer pink <Text style={{color: 'red'}}>nested red</Text>
</Text>
<Text style={{backgroundColor: 'green'}}>
Outer on green{' '}
<Text style={{color: 'white'}}>nested white on inherit green</Text>
</Text>
<Text style={{backgroundColor: 'green', color: 'orange'}}>
Outer orange on green{' '}
<Text style={{backgroundColor: 'blue', color: 'white'}}>
nested white on blue
</Text>
</Text>
<Text style={{color: 'orange'}}>
Outer orange{' '}
<Text style={{backgroundColor: 'blue', color: 'white'}}>
nested white on blue
</Text>
</Text>
<Text style={{color: 'orange'}}>
<Text style={{backgroundColor: 'blue'}}>
nested orange inherit on blue
</Text>
</Text>

<Text>
Outer no_color{' '}
<Text style={{backgroundColor: 'green'}}>
<Text style={{backgroundColor: 'green', color: 'white'}}>
START_NESTED green{' '}
<Text style={{backgroundColor: 'blue'}}>DEEPER_NESTED blue</Text>{' '}
<Text style={{backgroundColor: 'blue', color: 'magenta'}}>
DEEPER_NESTED magenta on blue
</Text>{' '}
END_NESTED
</Text>{' '}
attributes.
Expand Down

0 comments on commit 440f694

Please sign in to comment.