From 1b7a7cda2ee1459d0281c0e68fbe5559ee4b7b40 Mon Sep 17 00:00:00 2001 From: Subin C Date: Tue, 23 Jul 2024 15:23:39 +0530 Subject: [PATCH] Avoid multiple Handle click outside --- components/CollaborativeRoom.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); }