mirror of
https://github.com/usememos/memos.git
synced 2025-11-12 18:32:02 +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
1 changed files with 3 additions and 0 deletions
|
|
@ -10,6 +10,9 @@ const useAutoComplete = (actions: EditorRefActions) => {
|
||||||
|
|
||||||
editor.addEventListener("keydown", (event) => {
|
editor.addEventListener("keydown", (event) => {
|
||||||
if (event.key === "Enter") {
|
if (event.key === "Enter") {
|
||||||
|
if (event.isComposing) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
const cursorPosition = actions.getCursorPosition();
|
const cursorPosition = actions.getCursorPosition();
|
||||||
const prevContent = actions.getContent().substring(0, cursorPosition);
|
const prevContent = actions.getContent().substring(0, cursorPosition);
|
||||||
const lastNode = last(window.parse(prevContent));
|
const lastNode = last(window.parse(prevContent));
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue