From 3fd4ee83accc887c287a56ddc9ce09facc82c1c3 Mon Sep 17 00:00:00 2001 From: Zeng1998 <1129142694@qq.com> Date: Mon, 12 Dec 2022 18:30:04 +0800 Subject: [PATCH] fix: checklist auto continuation (#737) --- web/src/components/MemoEditor.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/web/src/components/MemoEditor.tsx b/web/src/components/MemoEditor.tsx index 0054d9f2..120a6508 100644 --- a/web/src/components/MemoEditor.tsx +++ b/web/src/components/MemoEditor.tsx @@ -14,7 +14,7 @@ import ResourceIcon from "./ResourceIcon"; import showResourcesSelectorDialog from "./ResourcesSelectorDialog"; import "../less/memo-editor.less"; -const listItemSymbolList = ["* ", "- ", "- [ ] ", "- [x] ", "- [X] "]; +const listItemSymbolList = ["- [ ] ", "- [x] ", "- [X] ", "* ", "- "]; const getEditorContentCache = (): string => { return storage.get(["editorContentCache"]).editorContentCache ?? ""; @@ -132,6 +132,7 @@ const MemoEditor = () => { if (rowValue.startsWith(listItemSymbol)) { event.preventDefault(); editorRef.current.insertText("", `\n${listItemSymbol}`); + break; } } }