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 {
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}
You can’t perform that action at this time.
0 commit comments