mirror of
https://github.com/usememos/memos.git
synced 2024-09-20 14:35:54 +08:00
fix: editor IME composing event behavior (#3267)
* fix: editor IME composing event behavior * fix: editor IME composing event behavior * Update web/src/components/MemoEditor/hooks/useAutoComplete.ts --------- Co-authored-by: boojack <stevenlgtm@gmail.com>
This commit is contained in:
parent
205bf7ed0e
commit
9bcd4f59a2
|
@ -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));
|
||||
|
|
Loading…
Reference in a new issue