Skip to content

Commit 00962a2

Browse files
committed
fix(swap): connect wallet modal breaks if was closed using swipe (#6605)
1 parent 36f30f6 commit 00962a2

File tree

1 file changed

+4
-1
lines changed
  • apps/cowswap-frontend/src/common/pure/Modal

1 file changed

+4
-1
lines changed

apps/cowswap-frontend/src/common/pure/Modal/index.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,11 @@ export function Modal({
5454
const bind = useGesture({
5555
onDrag: (state) => {
5656
y.set(state.down ? state.movement[1] : 0)
57+
},
58+
onDragEnd: (state) => {
5759
if (state.movement[1] > 300 || (state.velocity[1] > 3 && state.direction[1] > 0)) {
5860
onDismiss()
61+
y.set(0)
5962
}
6063
},
6164
})
@@ -85,7 +88,7 @@ export function Modal({
8588
{...(isMobile
8689
? {
8790
...bind(),
88-
style: { transform: y.interpolate((y) => `translateY(${(y as number) > 0 ? y : 0}px)`) },
91+
style: { transform: y.to((y) => `translateY(${y > 0 ? y : 0}px)`) },
8992
}
9093
: {})}
9194
aria-label={t`dialog content`}

0 commit comments

Comments
 (0)