File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -76,9 +76,8 @@ export default class Text extends PureBaseComponent {
76
76
77
77
renderText ( children ) {
78
78
const { highlightString, highlightStyle} = this . props ;
79
-
79
+
80
80
if ( ! _ . isEmpty ( highlightString ) ) {
81
-
82
81
if ( _ . isArray ( children ) ) {
83
82
return _ . map ( children , child => {
84
83
return this . renderText ( child ) ;
@@ -90,7 +89,10 @@ export default class Text extends PureBaseComponent {
90
89
return _ . map ( textParts , ( text , index ) => {
91
90
const shouldHighlight = _ . lowerCase ( text ) === _ . lowerCase ( highlightString ) ;
92
91
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
+ >
94
96
{ text }
95
97
</ Text >
96
98
) ;
@@ -144,6 +146,9 @@ function createStyles() {
144
146
} ,
145
147
highlight : {
146
148
color : Colors . grey30
149
+ } ,
150
+ notHighlight : {
151
+ color : undefined
147
152
}
148
153
} ) ;
149
154
}
You can’t perform that action at this time.
0 commit comments