aboutsummaryrefslogtreecommitdiff
path: root/plugins/base/frontend/src/main
diff options
context:
space:
mode:
authorMarcin Aman <marcin.aman@gmail.com>2021-07-20 15:53:25 +0200
committerGitHub <noreply@github.com>2021-07-20 15:53:25 +0200
commit4f701027ac0a5de6c52fb6285edf79752c84ad0e (patch)
tree6202a52ab5119b7f05413953b40b18622aa09e57 /plugins/base/frontend/src/main
parent01ce00036a403c1d6bba3cb1b4c228f2df3f8b6c (diff)
downloaddokka-4f701027ac0a5de6c52fb6285edf79752c84ad0e.tar.gz
dokka-4f701027ac0a5de6c52fb6285edf79752c84ad0e.tar.bz2
dokka-4f701027ac0a5de6c52fb6285edf79752c84ad0e.zip
Remove limitation on minimal matched length (#1978)
Diffstat (limited to 'plugins/base/frontend/src/main')
-rw-r--r--plugins/base/frontend/src/main/components/search/dokkaFuzzyFilter.tsx8
1 files changed, 1 insertions, 7 deletions
diff --git a/plugins/base/frontend/src/main/components/search/dokkaFuzzyFilter.tsx b/plugins/base/frontend/src/main/components/search/dokkaFuzzyFilter.tsx
index 98fb1455..89e77252 100644
--- a/plugins/base/frontend/src/main/components/search/dokkaFuzzyFilter.tsx
+++ b/plugins/base/frontend/src/main/components/search/dokkaFuzzyFilter.tsx
@@ -38,12 +38,6 @@ const highlightMatchedPhrases = (records: OptionWithSearchResult[]): OptionWithH
}
})
}
-
-const hasAnyMatchedPhraseLongerThan = (searchResult: OptionWithSearchResult, length: number): boolean => {
- const values = _.chunk(signatureFromSearchResult(searchResult).split("**"), 2).map(([txt, matched]) => matched ? matched.length >= length : null)
- return values.reduce((acc, element) => acc || element)
-}
-
export class DokkaFuzzyFilterComponent extends Select {
componentDidUpdate(prevProps, prevState) {
super.componentDidUpdate(prevProps, prevState)
@@ -94,7 +88,7 @@ export class DokkaFuzzyFilterComponent extends Select {
}
})
- .filter((record: OptionWithSearchResult) => record.matched && (hasAnyMatchedPhraseLongerThan(record, 3) || filterPhrase.length < 3))
+ .filter((record: OptionWithSearchResult) => record.matched)
this.props.onFilter(filterPhrase)