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 {
5353 ZStack {
5454 if let image = assetLoader. loadedImages [ asset. localIdentifier] {
5555 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+ )
7181 )
72- )
82+ }
7383 }
7484 }
75- }
85+ }
7686 }
7787 } else {
7888 Color ( colors. background1)
You can’t perform that action at this time.
0 commit comments