Skip to content

Commit bb94f43

Browse files
fixed regression with scrolling to quoted message
1 parent 5de86bb commit bb94f43

File tree

4 files changed

+8
-2
lines changed

4 files changed

+8
-2
lines changed

Sources/StreamChatSwiftUI/ChatChannel/Gallery/GalleryView.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ struct GalleryView: View {
4545
LazyLoadingImage(
4646
source: url,
4747
width: reader.size.width,
48+
height: reader.size.height,
4849
resize: true,
4950
onImageLoaded: { image in
5051
loadedImages[index] = image

Sources/StreamChatSwiftUI/ChatChannel/Gallery/GridPhotosView.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ struct GridPhotosView: View {
3434
ForEach(imageURLs, id: \.self) { url in
3535
LazyLoadingImage(
3636
source: url,
37-
width: Self.itemWidth
37+
width: Self.itemWidth,
38+
height: Self.itemWidth
3839
)
3940
.frame(
4041
width: Self.itemWidth,

Sources/StreamChatSwiftUI/ChatChannel/MessageList/ImageAttachmentView.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,7 @@ struct SingleImageView: View {
246246
LazyLoadingImage(
247247
source: source,
248248
width: width,
249+
height: 3 * width / 4,
249250
imageTapped: imageTapped,
250251
index: index
251252
)
@@ -264,6 +265,7 @@ struct MultiImageView: View {
264265
LazyLoadingImage(
265266
source: source,
266267
width: width,
268+
height: height,
267269
imageTapped: imageTapped,
268270
index: index
269271
)
@@ -280,6 +282,7 @@ struct LazyLoadingImage: View {
280282

281283
let source: URL
282284
let width: CGFloat
285+
let height: CGFloat
283286
var resize: Bool = true
284287
var imageTapped: ((Int) -> Void)? = nil
285288
var index: Int?
@@ -294,7 +297,7 @@ struct LazyLoadingImage: View {
294297
// The click area expands outside the image view (although not visible).
295298
Rectangle()
296299
.opacity(0.000001)
297-
.frame(width: width)
300+
.frame(width: width, height: height)
298301
.clipped()
299302
.allowsHitTesting(true)
300303
.highPriorityGesture(

Sources/StreamChatSwiftUI/ChatChannel/MessageList/QuotedMessageView.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ struct QuotedMessageView: View {
7171
LazyLoadingImage(
7272
source: quotedMessage.imageAttachments[0].imagePreviewURL,
7373
width: attachmentWidth,
74+
height: attachmentWidth,
7475
resize: false
7576
)
7677
} else if !quotedMessage.giphyAttachments.isEmpty {

0 commit comments

Comments
 (0)