diff --git a/src/components/room/RoomChatPanel.tsx b/src/components/room/RoomChatPanel.tsx index fd1af43..da82307 100644 --- a/src/components/room/RoomChatPanel.tsx +++ b/src/components/room/RoomChatPanel.tsx @@ -104,8 +104,13 @@ const ChatInputArea = memo(function ChatInputArea({ count += node.length; } if (count !== prevCursorRef.current) { - prevCursorRef.current = count; - ms.setCursorOffset(count); + // Skip update when caret is at end of text (programmatic value change + // that already positioned the caret — the caret hasn't moved from the + // user's perspective). Only update on real user-initiated cursor movement. + if (count !== ms.value.length || prevCursorRef.current !== ms.value.length) { + prevCursorRef.current = count; + ms.setCursorOffset(count); + } } });