File tree Expand file tree Collapse file tree 1 file changed +9
-12
lines changed
Sources/ComponentsKit/Components/Card Expand file tree Collapse file tree 1 file changed +9
-12
lines changed Original file line number Diff line number Diff line change @@ -59,22 +59,19 @@ public struct SUCard<Content: View>: View {
59
59
. shadow ( self . model. shadow)
60
60
. observeSize { self . contentSize = $0 }
61
61
. contentShape ( . rect)
62
- . gesture (
62
+ . onTapGesture {
63
+ guard self . model. isTappable else { return }
64
+ self . onTap ( )
65
+ }
66
+ . simultaneousGesture (
63
67
DragGesture ( minimumDistance: 0.0 )
64
68
. onChanged { _ in
65
- guard self . model. isTappable else { return }
66
69
self . isPressed = true
67
70
}
68
- . onEnded { value in
69
- guard self . model. isTappable else { return }
70
-
71
- defer { self . isPressed = false }
72
-
73
- if CGRect ( origin: . zero, size: self . contentSize)
74
- . contains ( value. location) {
75
- self . onTap ( )
76
- }
77
- }
71
+ . onEnded { _ in
72
+ self . isPressed = false
73
+ } ,
74
+ isEnabled: self . model. isTappable
78
75
)
79
76
. scaleEffect (
80
77
self . isPressed ? self . model. animationScale. value : 1 ,
You can’t perform that action at this time.
0 commit comments