From da6d2cf9dff11658826c268311ea71374b486a4c Mon Sep 17 00:00:00 2001 From: Alexander Zinchuk Date: Fri, 15 May 2026 18:37:51 +0200 Subject: [PATCH] Edit Topic: Add confirm edit on Enter for topics (#6947) --- src/components/right/EditTopic.tsx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/components/right/EditTopic.tsx b/src/components/right/EditTopic.tsx index 488f9d0cf..10f54f70f 100644 --- a/src/components/right/EditTopic.tsx +++ b/src/components/right/EditTopic.tsx @@ -95,6 +95,15 @@ const EditTopic: FC = ({ }); }, [chat, editTopic, iconEmojiId, title, topic]); + const handleTitleKeyDown = useCallback((e: React.KeyboardEvent) => { + if (e.key !== 'Enter' || e.isComposing || isLoading || !isTouched) { + return; + } + + e.preventDefault(); + handleEditTopic(); + }, [handleEditTopic, isLoading, isTouched]); + const handleCustomEmojiSelect = useCallback((emoji: ApiSticker) => { if (!emoji.isFree && !isCurrentUserPremium && emoji.id !== DEFAULT_TOPIC_ICON_STICKER_ID) { openPremiumModal({ initialSection: 'animated_emoji' }); @@ -146,6 +155,7 @@ const EditTopic: FC = ({