Skip to content

Commit 5e88503

Browse files
Fixed message resizing bug while swiping
1 parent 38a349b commit 5e88503

File tree

3 files changed

+24
-8
lines changed

3 files changed

+24
-8
lines changed

Sources/StreamChatSwiftUI/ChatChannel/MessageList/MessageContainerView.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,6 @@ struct MessageContainerView<Factory: ViewFactory>: View {
5454
}
5555
}
5656

57-
if offsetX > 0 {
58-
VStack {
59-
Image(uiImage: images.messageActionInlineReply)
60-
Spacer()
61-
}
62-
.padding(.horizontal)
63-
}
64-
6557
VStack(alignment: message.isSentByCurrentUser ? .trailing : .leading) {
6658
if isMessagePinned {
6759
MessagePinDetailsView(
@@ -165,6 +157,14 @@ struct MessageContainerView<Factory: ViewFactory>: View {
165157
}
166158
}
167159
}
160+
.overlay(
161+
offsetX > 0 ?
162+
TopLeftView {
163+
Image(uiImage: images.messageActionInlineReply)
164+
}
165+
.offset(x: -32)
166+
: nil
167+
)
168168

169169
if !message.isSentByCurrentUser {
170170
MessageSpacer(spacerWidth: spacerWidth)

Sources/StreamChatSwiftUI/ChatChannel/MessageList/MessageListHelperViews.swift

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,3 +108,18 @@ struct MessagePinDetailsView: View {
108108
.padding(.top, 4)
109109
}
110110
}
111+
112+
struct TopLeftView<Content: View>: View {
113+
114+
var content: () -> Content
115+
116+
var body: some View {
117+
VStack {
118+
HStack {
119+
content()
120+
Spacer()
121+
}
122+
Spacer()
123+
}
124+
}
125+
}

Sources/StreamChatSwiftUI/ChatChannel/MessageList/QuotedMessageView.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ struct QuotedMessageView: View {
112112
Spacer()
113113
}
114114
}
115+
.id(quotedMessage.messageId)
115116
.padding(.all, 8)
116117
.messageBubble(
117118
for: quotedMessage,

0 commit comments

Comments
 (0)