From 27a2711343135f8d5b784bf446941a377a533488 Mon Sep 17 00:00:00 2001 From: ab Date: Fri, 5 Jul 2019 13:45:21 -0400 Subject: unhigh --- src/client/views/search/SearchItem.tsx | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/client/views/search') 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 { 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; + } + } } -- cgit v1.2.3-70-g09d2