From 5d6df87af09023a33b4abf2d60c60b4ff98766f8 Mon Sep 17 00:00:00 2001 From: STEVEN Date: Tue, 24 May 2022 18:07:46 +0800 Subject: [PATCH] fix: sort tags in creating shortcut (#69) --- web/src/components/CreateShortcutDialog.tsx | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/web/src/components/CreateShortcutDialog.tsx b/web/src/components/CreateShortcutDialog.tsx index cadb0952..6bf5d173 100644 --- a/web/src/components/CreateShortcutDialog.tsx +++ b/web/src/components/CreateShortcutDialog.tsx @@ -152,6 +152,7 @@ interface MemoFilterInputerProps { const FilterInputer: React.FC = (props: MemoFilterInputerProps) => { const { index, filter, handleFilterChange, handleFilterRemove } = props; + const tags = Array.from(memoService.getState().tags); const { type } = filter; const [inputElements, setInputElements] = useState(<>); @@ -185,12 +186,9 @@ const FilterInputer: React.FC = (props: MemoFilterInpute valueElement = ( { - return { text: t, value: t }; - })} + dataSource={tags.sort().map((t) => { + return { text: t, value: t }; + })} value={filter.value.value} handleValueChanged={handleValueChange} />