We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 36f30f6 commit 00962a2Copy full SHA for 00962a2
apps/cowswap-frontend/src/common/pure/Modal/index.tsx
@@ -54,8 +54,11 @@ export function Modal({
54
const bind = useGesture({
55
onDrag: (state) => {
56
y.set(state.down ? state.movement[1] : 0)
57
+ },
58
+ onDragEnd: (state) => {
59
if (state.movement[1] > 300 || (state.velocity[1] > 3 && state.direction[1] > 0)) {
60
onDismiss()
61
+ y.set(0)
62
}
63
},
64
})
@@ -85,7 +88,7 @@ export function Modal({
85
88
{...(isMobile
86
89
? {
87
90
...bind(),
- 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)`) },
92
93
: {})}
94
aria-label={t`dialog content`}
0 commit comments