Skip to content

Commit 214ab89

Browse files
committed
Hotfix issue with highlight text feature when setting default color
1 parent 7a584cb commit 214ab89

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/components/text/index.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,8 @@ export default class Text extends PureBaseComponent {
7676

7777
renderText(children) {
7878
const {highlightString, highlightStyle} = this.props;
79-
79+
8080
if (!_.isEmpty(highlightString)) {
81-
8281
if (_.isArray(children)) {
8382
return _.map(children, child => {
8483
return this.renderText(child);
@@ -90,7 +89,10 @@ export default class Text extends PureBaseComponent {
9089
return _.map(textParts, (text, index) => {
9190
const shouldHighlight = _.lowerCase(text) === _.lowerCase(highlightString);
9291
return (
93-
<Text key={index} style={shouldHighlight && [this.styles.highlight, highlightStyle]}>
92+
<Text
93+
key={index}
94+
style={shouldHighlight ? [this.styles.highlight, highlightStyle] : this.styles.notHighlight}
95+
>
9496
{text}
9597
</Text>
9698
);
@@ -144,6 +146,9 @@ function createStyles() {
144146
},
145147
highlight: {
146148
color: Colors.grey30
149+
},
150+
notHighlight: {
151+
color: undefined
147152
}
148153
});
149154
}

0 commit comments

Comments
 (0)