Skip to content

Commit 0884e47

Browse files
Fixed layout issue for link attachments
1 parent c42a70f commit 0884e47

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Sources/StreamChatSwiftUI/ChatChannel/MessageList/LinkAttachmentView.swift

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,15 @@ public struct LinkAttachmentContainer<Factory: ViewFactory>: View {
3535
)
3636
}
3737

38-
let size = message.text.frameSize(maxWidth: width - 2 * padding)
38+
let availableWidth = width - 4 * padding
39+
let size = message.text.frameSize(maxWidth: availableWidth)
3940
LinkTextView(
4041
text: message.text,
41-
width: width - 2 * padding,
42+
width: availableWidth,
4243
textColor: UIColor(textColor(for: message))
4344
)
45+
.frame(width: availableWidth, height: size.height)
4446
.standardPadding()
45-
.frame(width: width, height: size.height + 2 * padding)
4647

4748
if !message.linkAttachments.isEmpty {
4849
LinkAttachmentView(

0 commit comments

Comments
 (0)