Skip to content

Commit db0cfb9

Browse files
committed
Fix: Prevent false taps on interactive elements during card swipe
Disabled interactions with clickable elements (e.g., buttons) on cards while swiping to prevent unintended actions caused by simultaneous gestures.
1 parent 8ea1f5a commit db0cfb9

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Sources/CardStack/CardView.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ struct CardView<Direction, Content: View>: View {
2424
var body: some View {
2525
GeometryReader { geometry in
2626
self.content(self.swipeDirection(geometry))
27+
.disabled(self.translation != .zero)
2728
.offset(self.translation)
2829
.rotationEffect(self.rotation(geometry))
2930
.simultaneousGesture(self.isOnTop ? self.dragGesture(geometry) : nil)

0 commit comments

Comments
 (0)