From 2f40efb2fcc3972ec2d0d63d509d1cb75a2c19bf Mon Sep 17 00:00:00 2001 From: Harry <109690906+harry-signal@users.noreply.github.com> Date: Wed, 9 Aug 2023 10:41:55 -0700 Subject: [PATCH] Include horizontal text view insets when computing message compose text bounding box --- .../ConversationView/ConversationInputToolbar.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Signal/src/ViewControllers/ConversationView/ConversationInputToolbar.swift b/Signal/src/ViewControllers/ConversationView/ConversationInputToolbar.swift index f296d94c40..d4eb31c008 100644 --- a/Signal/src/ViewControllers/ConversationView/ConversationInputToolbar.swift +++ b/Signal/src/ViewControllers/ConversationView/ConversationInputToolbar.swift @@ -2083,7 +2083,7 @@ extension ConversationInputToolbar: ConversationTextViewToolbarDelegate { private func updateHeightWithTextView(_ textView: UITextView) { - let maxSize = CGSize(width: textView.width, height: CGFloat.greatestFiniteMagnitude) + let maxSize = CGSize(width: textView.width - textView.textContainerInset.totalWidth, height: CGFloat.greatestFiniteMagnitude) var contentSize = textView.attributedText.boundingRect(with: maxSize, options: [.usesLineFragmentOrigin, .usesFontLeading], context: nil).size contentSize.height += textView.textContainerInset.top contentSize.height += textView.textContainerInset.bottom