diff options
| author | ab <abdullah_ahmed@brown.edu> | 2019-07-05 13:45:21 -0400 |
|---|---|---|
| committer | ab <abdullah_ahmed@brown.edu> | 2019-07-05 13:45:21 -0400 |
| commit | 27a2711343135f8d5b784bf446941a377a533488 (patch) | |
| tree | dbb661df0c5c6af0323b64ad90ba3297b56c2946 /src/client/views/search | |
| parent | a223d6a4283c976ad3c5a2fd97df5a6bb0542722 (diff) | |
unhigh
Diffstat (limited to 'src/client/views/search')
| -rw-r--r-- | src/client/views/search/SearchItem.tsx | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/client/views/search/SearchItem.tsx b/src/client/views/search/SearchItem.tsx index d2e57c5ca..9c91c524b 100644 --- a/src/client/views/search/SearchItem.tsx +++ b/src/client/views/search/SearchItem.tsx @@ -149,12 +149,14 @@ export class SearchItem extends React.Component<SearchItemProps> { highlightTextBox = (doc: Doc) => { if (this.props.query) { - doc.search_string = this.props.query; - // FormattedTextBox.Instance.highlightSearchTerms([this.props.query]); - } - else { - // FormattedTextBox.Instance.highlightSearchTerms(["hello"]); - doc.search_string = "hello"; + const fieldkey = 'search_string'; + if (Object.keys(doc).indexOf(fieldkey) === -1) { + doc.search_string = this.props.query; + } + else { + doc.search_string = undefined; + } + } } |
