Unverified Commit 3fd4ee83 authored by Zeng1998's avatar Zeng1998 Committed by GitHub

fix: checklist auto continuation (#737)

parent 5e978e2c
...@@ -14,7 +14,7 @@ import ResourceIcon from "./ResourceIcon"; ...@@ -14,7 +14,7 @@ import ResourceIcon from "./ResourceIcon";
import showResourcesSelectorDialog from "./ResourcesSelectorDialog"; import showResourcesSelectorDialog from "./ResourcesSelectorDialog";
import "../less/memo-editor.less"; import "../less/memo-editor.less";
const listItemSymbolList = ["* ", "- ", "- [ ] ", "- [x] ", "- [X] "]; const listItemSymbolList = ["- [ ] ", "- [x] ", "- [X] ", "* ", "- "];
const getEditorContentCache = (): string => { const getEditorContentCache = (): string => {
return storage.get(["editorContentCache"]).editorContentCache ?? ""; return storage.get(["editorContentCache"]).editorContentCache ?? "";
...@@ -132,6 +132,7 @@ const MemoEditor = () => { ...@@ -132,6 +132,7 @@ const MemoEditor = () => {
if (rowValue.startsWith(listItemSymbol)) { if (rowValue.startsWith(listItemSymbol)) {
event.preventDefault(); event.preventDefault();
editorRef.current.insertText("", `\n${listItemSymbol}`); editorRef.current.insertText("", `\n${listItemSymbol}`);
break;
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment