Skip to content

Commit

Permalink
fix: 한글 컴포징시 윈도우도 스페이스바 추가하는 문제 해결
Browse files Browse the repository at this point in the history
Co-authored-by: hyonun <[email protected]>
Co-authored-by: Jang seo yun <[email protected]>
Co-authored-by: minjungw00 <[email protected]>
  • Loading branch information
4 people committed Dec 2, 2024
1 parent bd116d3 commit 2ef1cca
Showing 1 changed file with 11 additions and 15 deletions.
26 changes: 11 additions & 15 deletions client/src/features/editor/Editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,6 @@ export const Editor = ({ onTitleChange, pageId, pageTitle, serializedEditorData
blockId: block.id,
pageId,
});
sendCharInsertOperation(block.crdt.localInsert(currentCaret + 1, "", block.id, pageId));

block.crdt.currentCaret = currentCaret;
}
Expand All @@ -246,22 +245,19 @@ export const Editor = ({ onTitleChange, pageId, pageTitle, serializedEditorData
if (activeElement?.tagName.toLowerCase() === "input") {
return; // input에 포커스가 있으면 캐럿 위치 변경하지 않음
}
if (isLocalChange.current || isSameLocalChange.current) {
setCaretPosition({
blockId: editorCRDT.current.currentBlock.id,
linkedList: editorCRDT.current.LinkedList,
position: editorCRDT.current.currentBlock?.crdt.currentCaret,
pageId,
});
isLocalChange.current = false;
if (composingCaret.current !== null) {
isSameLocalChange.current = true;
} else {
requestAnimationFrame(() => {
if (isLocalChange.current || isSameLocalChange.current) {
setCaretPosition({
blockId: editorCRDT.current.currentBlock!.id,
linkedList: editorCRDT.current.LinkedList,
position: editorCRDT.current.currentBlock?.crdt.currentCaret,
pageId,
});
isLocalChange.current = false;
isSameLocalChange.current = false;
return;
}

return;
}
});
// 서윤님 피드백 반영
}, [editorCRDT.current.currentBlock?.id.serialize()]);

Expand Down

0 comments on commit 2ef1cca

Please sign in to comment.