From 3e9d8e04af46e2845335c9e8add072afac356ce9 Mon Sep 17 00:00:00 2001 From: yuriipopow Date: Mon, 3 Aug 2026 01:02:47 +0300 Subject: [PATCH] fix voice message ui bug --- .../Sources/ChatTextInputPanelNode.swift | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/submodules/TelegramUI/Components/Chat/ChatTextInputPanelNode/Sources/ChatTextInputPanelNode.swift b/submodules/TelegramUI/Components/Chat/ChatTextInputPanelNode/Sources/ChatTextInputPanelNode.swift index 826bdb4098d..116f0180560 100644 --- a/submodules/TelegramUI/Components/Chat/ChatTextInputPanelNode/Sources/ChatTextInputPanelNode.swift +++ b/submodules/TelegramUI/Components/Chat/ChatTextInputPanelNode/Sources/ChatTextInputPanelNode.swift @@ -1810,7 +1810,13 @@ public class ChatTextInputPanelNode: ChatInputPanelNode, ASEditableTextNodeDeleg } } - let inputHasText = !(self.richTextInputNode?.inputContentIsEmpty ?? true) + // While a media recording is in progress the text field is faded out entirely (see + // audioRecordingItemsAlpha), but it can still be first responder and keep receiving keystrokes + // from an attached/software keyboard. Treating that invisible text as present would drive the + // whole right-hand side of the panel into its "send text" layout — which parks the recording + // controls (the mic/send-voice button) off screen at `width + 8.0`. The recording layout must + // stay independent of the field's content. + let inputHasText = !isRecording && !(self.richTextInputNode?.inputContentIsEmpty ?? true) var hasMenuButton = false var menuButtonExpanded = false