diff --git a/src/pages/common/components/ChatComponent/ChatComponent.tsx b/src/pages/common/components/ChatComponent/ChatComponent.tsx index 99b2bec6b4..c7350bd0b1 100644 --- a/src/pages/common/components/ChatComponent/ChatComponent.tsx +++ b/src/pages/common/components/ChatComponent/ChatComponent.tsx @@ -88,6 +88,7 @@ import { } from "./utils"; import styles from "./ChatComponent.module.scss"; import { BaseTextEditorHandles } from "@/shared/ui-kit/TextEditor/BaseTextEditor"; +import { useFeedItemContext } from "../FeedItem"; const BASE_CHAT_INPUT_HEIGHT = 48; const BASE_ORDER_INTERVAL = 1000; @@ -258,6 +259,20 @@ export default function ChatComponent({ parseStringToTextEditorValue(), ); + const { + setIsInputFocused + } = useFeedItemContext(); + + useEffect(() => { + const isEmpty = checkIsTextEditorValueEmpty(message); + if(!isEmpty || message.length > 1) { + setIsInputFocused?.(true); + } else { + setIsInputFocused?.(false); + } + + },[message, setIsInputFocused]) + const emojiCount = useMemo( () => countTextEditorEmojiElements(message), [message], diff --git a/src/pages/common/components/DiscussionFeedCard/DiscussionFeedCard.tsx b/src/pages/common/components/DiscussionFeedCard/DiscussionFeedCard.tsx index 61547c2016..dcd82a373c 100644 --- a/src/pages/common/components/DiscussionFeedCard/DiscussionFeedCard.tsx +++ b/src/pages/common/components/DiscussionFeedCard/DiscussionFeedCard.tsx @@ -218,12 +218,6 @@ function DiscussionFeedCard(props, ref) { const cardTitle = discussion?.title; const commonNotion = outerCommonNotion ?? common?.notion; - // const ownerId = useMemo(() => { - // if(item.userId) { - // return item.userId - // } - // },[item.userId]) - const handleOpenChat = useCallback(() => { if (discussion && !isPreviewMode) { setChatItem({ diff --git a/src/pages/common/components/FeedCard/FeedCard.tsx b/src/pages/common/components/FeedCard/FeedCard.tsx index 1b1625819a..5fac7dcb50 100644 --- a/src/pages/common/components/FeedCard/FeedCard.tsx +++ b/src/pages/common/components/FeedCard/FeedCard.tsx @@ -299,7 +299,7 @@ const FeedCard = (props, ref) => { ]); return ( -