Include horizontal text view insets when computing message compose text bounding box

This commit is contained in:
Harry 2023-08-09 10:41:55 -07:00 committed by GitHub
parent 640a54af46
commit 2f40efb2fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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