diff --git a/submodules/AttachmentTextInputPanelNode/Sources/AttachmentTextInputPanelNode.swift b/submodules/AttachmentTextInputPanelNode/Sources/AttachmentTextInputPanelNode.swift index 93ddd3224b..261ccc1b6d 100644 --- a/submodules/AttachmentTextInputPanelNode/Sources/AttachmentTextInputPanelNode.swift +++ b/submodules/AttachmentTextInputPanelNode/Sources/AttachmentTextInputPanelNode.swift @@ -632,8 +632,10 @@ public class AttachmentTextInputPanelNode: ASDisplayNode, TGCaptionPanelView, AS } private func calculateTextFieldMetrics(width: CGFloat, maxHeight: CGFloat, metrics: LayoutMetrics) -> (accessoryButtonsWidth: CGFloat, textFieldHeight: CGFloat) { - let textFieldInsets = self.textFieldInsets(metrics: metrics) - + var textFieldInsets = self.textFieldInsets(metrics: metrics) + if self.actionButtons.frame.width > 44.0 { + textFieldInsets.right = self.actionButtons.frame.width + } let fieldMaxHeight = textFieldMaxHeight(maxHeight, metrics: metrics) var textFieldMinHeight: CGFloat = 35.0 diff --git a/submodules/TelegramUI/Sources/ChatTextInputPanelNode.swift b/submodules/TelegramUI/Sources/ChatTextInputPanelNode.swift index 21853370d7..aa3bc0eb74 100644 --- a/submodules/TelegramUI/Sources/ChatTextInputPanelNode.swift +++ b/submodules/TelegramUI/Sources/ChatTextInputPanelNode.swift @@ -1316,7 +1316,10 @@ class ChatTextInputPanelNode: ChatInputPanelNode, ASEditableTextNodeDelegate, Ch let accessoryButtonInset = self.accessoryButtonInset let accessoryButtonSpacing = self.accessoryButtonSpacing - let textFieldInsets = self.textFieldInsets(metrics: metrics) + var textFieldInsets = self.textFieldInsets(metrics: metrics) + if self.actionButtons.frame.width > 44.0 { + textFieldInsets.right = self.actionButtons.frame.width - 2.0 + } let fieldMaxHeight = textFieldMaxHeight(maxHeight, metrics: metrics)