commit f5ba71ad56eda8a886e9ae0b9ddd882a0b3c9e3d parent 564874786be906e04f4ae88ffb1d40a82892f389 Author: Agastya Chandrakant <acagastya@outlook.com> Date: Wed, 27 May 2020 15:49:08 +0530 make sort work with spaces, and conditional priority sort Diffstat:
M | src/App/comps/TimezoneInput.tsx | | | 4 | +++- |
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/App/comps/TimezoneInput.tsx b/src/App/comps/TimezoneInput.tsx @@ -37,8 +37,10 @@ function TimezoneInput({ let recommendations: string[] | [] = []; if (value.length) { recommendations = options.filter((option) => - option.toLowerCase().includes(value.toLowerCase()) + option.toLowerCase().includes(unfriendlyStr(value).toLowerCase()) ); + if (value.length <= 3) + recommendations.sort((a, b) => a.length - b.length); } else { recommendations = [...options]; }