diff --git a/Sources/ComponentsKit/Components/Card/SUCard.swift b/Sources/ComponentsKit/Components/Card/SUCard.swift index 0f1934b..13cb8c5 100644 --- a/Sources/ComponentsKit/Components/Card/SUCard.swift +++ b/Sources/ComponentsKit/Components/Card/SUCard.swift @@ -59,22 +59,19 @@ public struct SUCard: View { .shadow(self.model.shadow) .observeSize { self.contentSize = $0 } .contentShape(.rect) - .gesture( + .onTapGesture { + guard self.model.isTappable else { return } + self.onTap() + } + .simultaneousGesture( DragGesture(minimumDistance: 0.0) .onChanged { _ in - guard self.model.isTappable else { return } self.isPressed = true } - .onEnded { value in - guard self.model.isTappable else { return } - - defer { self.isPressed = false } - - if CGRect(origin: .zero, size: self.contentSize) - .contains(value.location) { - self.onTap() - } - } + .onEnded { _ in + self.isPressed = false + }, + isEnabled: self.model.isTappable ) .scaleEffect( self.isPressed ? self.model.animationScale.value : 1,