diff --git a/components/CollaborativeRoom.tsx b/components/CollaborativeRoom.tsx index e77f3a2..5d4b4c2 100644 --- a/components/CollaborativeRoom.tsx +++ b/components/CollaborativeRoom.tsx @@ -42,7 +42,7 @@ const CollaborativeRoom = ({ roomId, roomMetadata, users, currentUserType }: Col useEffect(() => { const handleClickOutside = (e: MouseEvent) => { - if(containerRef.current && !containerRef.current.contains(e.target as Node)) { + if(inputRef.current && containerRef.current && !containerRef.current.contains(e.target as Node)) { setEditing(false); updateDocument(roomId, documentTitle); }