From 49efed73c7817c7784f97701539b7e4f9c4ca76b Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Mon, 4 Mar 2019 13:50:24 -0300 Subject: [PATCH] sort all select options alphabetically --- src/components/atoms/Form/Input.tsx | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/components/atoms/Form/Input.tsx b/src/components/atoms/Form/Input.tsx index 1d6a3a5..ad74e73 100644 --- a/src/components/atoms/Form/Input.tsx +++ b/src/components/atoms/Form/Input.tsx @@ -76,16 +76,18 @@ export default class Input extends PureComponent { > {options && - options.map((option: string, index: number) => ( - - ))} + options + .sort((a, b) => a.localeCompare(b)) + .map((option: string, index: number) => ( + + ))} )