mirror of
https://github.com/usememos/memos.git
synced 2025-06-05 22:09:59 +02:00
feat: toggle todo status by clicking (#99)
This commit is contained in:
@ -214,7 +214,7 @@ const MemoEditor: React.FC<Props> = () => {
|
||||
const prevString = currentValue.slice(0, selectionStart);
|
||||
const nextString = currentValue.slice(selectionStart);
|
||||
|
||||
let nextValue = prevString + "# " + nextString;
|
||||
let nextValue = prevString + "#" + nextString;
|
||||
let cursorIndex = prevString.length + 1;
|
||||
|
||||
if (prevString.endsWith("#") && nextString.startsWith(" ")) {
|
||||
@ -265,7 +265,7 @@ const MemoEditor: React.FC<Props> = () => {
|
||||
|
||||
const handleTagSeletorClick = useCallback((event: React.MouseEvent) => {
|
||||
if (tagSeletorRef.current !== event.target && tagSeletorRef.current?.contains(event.target as Node)) {
|
||||
editorRef.current?.insertText((event.target as HTMLElement).textContent ?? "");
|
||||
editorRef.current?.insertText((event.target as HTMLElement).textContent + " " ?? "");
|
||||
toggleTagSeletor(false);
|
||||
}
|
||||
}, []);
|
||||
|
Reference in New Issue
Block a user