File tree Expand file tree Collapse file tree 1 file changed +27
-17
lines changed
Sources/StreamChatSwiftUI/ChatChannel/Composer Expand file tree Collapse file tree 1 file changed +27
-17
lines changed Original file line number Diff line number Diff line change @@ -53,26 +53,36 @@ public struct PhotoAttachmentCell: View {
53
53
ZStack {
54
54
if let image = assetLoader. loadedImages [ asset. localIdentifier] {
55
55
GeometryReader { reader in
56
- Image ( uiImage: image)
57
- . resizable ( )
58
- . aspectRatio ( contentMode: . fill)
59
- . frame ( width: reader. size. width, height: reader. size. height)
60
- . clipped ( )
61
- . onTapGesture {
62
- withAnimation {
63
- if let assetURL = assetURL {
64
- onImageTap (
65
- AddedAsset (
66
- image: image,
67
- id: asset. localIdentifier,
68
- url: assetURL,
69
- type: asset. mediaType == . video ? . video : . image,
70
- extraData: asset. mediaType == . video ? [ " duration " : asset. durationString] : [ : ]
56
+ ZStack {
57
+ Image ( uiImage: image)
58
+ . resizable ( )
59
+ . aspectRatio ( contentMode: . fill)
60
+ . frame ( width: reader. size. width, height: reader. size. height)
61
+ . allowsHitTesting ( false )
62
+ . clipped ( )
63
+
64
+ // Needed because of SwiftUI bug with tap area of Image.
65
+ Rectangle ( )
66
+ . opacity ( 0.000001 )
67
+ . frame ( width: reader. size. width, height: reader. size. height)
68
+ . clipped ( )
69
+ . allowsHitTesting ( true )
70
+ . onTapGesture {
71
+ withAnimation {
72
+ if let assetURL = assetURL {
73
+ onImageTap (
74
+ AddedAsset (
75
+ image: image,
76
+ id: asset. localIdentifier,
77
+ url: assetURL,
78
+ type: asset. mediaType == . video ? . video : . image,
79
+ extraData: asset. mediaType == . video ? [ " duration " : asset. durationString] : [ : ]
80
+ )
71
81
)
72
- )
82
+ }
73
83
}
74
84
}
75
- }
85
+ }
76
86
}
77
87
} else {
78
88
Color ( colors. background1)
You can’t perform that action at this time.
0 commit comments