diff options
author | Marcin Aman <marcin.aman@gmail.com> | 2020-10-16 13:39:02 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-16 13:39:02 +0200 |
commit | c482ed6e688cb9e5105aa0d686613c8ad81905fb (patch) | |
tree | 385a9bc8f8144c1c05af4ccccf08afbbd270b5ee /plugins/base/frontend/src/main/components/search/searchResultRow.tsx | |
parent | 991913dc02f342615f33511f96891e5db7487cd4 (diff) | |
download | dokka-c482ed6e688cb9e5105aa0d686613c8ad81905fb.tar.gz dokka-c482ed6e688cb9e5105aa0d686613c8ad81905fb.tar.bz2 dokka-c482ed6e688cb9e5105aa0d686613c8ad81905fb.zip |
Explicit fallback in searchbar (#1559)
Diffstat (limited to 'plugins/base/frontend/src/main/components/search/searchResultRow.tsx')
-rw-r--r-- | plugins/base/frontend/src/main/components/search/searchResultRow.tsx | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/plugins/base/frontend/src/main/components/search/searchResultRow.tsx b/plugins/base/frontend/src/main/components/search/searchResultRow.tsx index 5910eec4..b9dbf482 100644 --- a/plugins/base/frontend/src/main/components/search/searchResultRow.tsx +++ b/plugins/base/frontend/src/main/components/search/searchResultRow.tsx @@ -1,5 +1,5 @@ import React from "react"; -import {OptionWithSearchResult, SearchProps, SearchRank} from "./types"; +import {OptionWithSearchResult, SearchProps} from "./types"; import _ from "lodash"; type HighlighterProps = { @@ -11,10 +11,7 @@ const Highlighter: React.FC<HighlighterProps> = ({label}: HighlighterProps) => { } export const signatureFromSearchResult = (searchResult: OptionWithSearchResult): string => { - if(searchResult.rank == SearchRank.SearchKeyMatch){ - return searchResult.name.replace(searchResult.searchKey, searchResult.highlight) - } - return searchResult.highlight + return searchResult.name.replace(searchResult.searchKeys[searchResult.rank], searchResult.highlight) } export const SearchResultRow: React.FC<SearchProps> = ({searchResult}: SearchProps) => { |