Skip to content

armgit / memos

Public Imported from GitHub
0

Memos is an open-source, self-hosted note-taking app that brings your everyday thoughts together in a personal timeline. Your data stays yours, and you choose what to keep private or share.

fix: editor IME composing event behavior (#3267)

SkyWT9bcd4f59a263
diff --git a/web/src/components/MemoEditor/hooks/useAutoComplete.ts b/web/src/components/MemoEditor/hooks/useAutoComplete.ts
index eb104e461..e28e1b1c1 100644
--- a/web/src/components/MemoEditor/hooks/useAutoComplete.ts
+++ b/web/src/components/MemoEditor/hooks/useAutoComplete.ts
@@ -10,6 +10,9 @@ const useAutoComplete = (actions: EditorRefActions) => {
editor.addEventListener("keydown", (event) => {
if (event.key === "Enter") {
+ if (event.isComposing) {
+ return;
+ }
const cursorPosition = actions.getCursorPosition();
const prevContent = actions.getContent().substring(0, cursorPosition);
const lastNode = last(window.parse(prevContent));