Skip to content

Commit

Permalink
improve filtering
Browse files Browse the repository at this point in the history
  • Loading branch information
HieronymusLex committed Sep 30, 2020
1 parent b9d1e86 commit 07f49f9
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions packages/desktop/src/components/RangeSearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,8 @@ export default ({ ranges, value = "", ...props }) => {
onSelect={onSelect}
options={ranges.map((r) => renderItem(r))}
filterOption={(inputValue, option) => {
return (
option.title.toLowerCase().indexOf(inputValue.toLowerCase()) !== -1
);
const searchParts = inputValue.split(" ");
return searchParts.every(part => option.title.toLowerCase().indexOf(part.toLowerCase()) !== -1);
}}
>
<Input.Search size="large" placeholder="Search ranges" />
Expand Down

0 comments on commit 07f49f9

Please sign in to comment.