From 07f49f9785939e722a2d89952ef92c75d15ddea3 Mon Sep 17 00:00:00 2001 From: Nick Lee Date: Wed, 30 Sep 2020 16:38:00 +0100 Subject: [PATCH] improve filtering --- packages/desktop/src/components/RangeSearch.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/desktop/src/components/RangeSearch.js b/packages/desktop/src/components/RangeSearch.js index 49f9519..94e7802 100644 --- a/packages/desktop/src/components/RangeSearch.js +++ b/packages/desktop/src/components/RangeSearch.js @@ -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); }} >