mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-10 00:27:41 +08:00
fix(modal): card style modal no longer gets stuck when swiping quickly (#21224)
This commit is contained in:
@ -39,16 +39,15 @@ export const createSwipeToCloseGesture = (
|
|||||||
};
|
};
|
||||||
|
|
||||||
const onMove = (detail: GestureDetail) => {
|
const onMove = (detail: GestureDetail) => {
|
||||||
const step = detail.deltaY / height;
|
const step = clamp(0.0001, detail.deltaY / height, 0.9999);
|
||||||
if (step < 0) { return; }
|
|
||||||
|
|
||||||
animation.progressStep(step);
|
animation.progressStep(step);
|
||||||
};
|
};
|
||||||
|
|
||||||
const onEnd = (detail: GestureDetail) => {
|
const onEnd = (detail: GestureDetail) => {
|
||||||
const velocity = detail.velocityY;
|
const velocity = detail.velocityY;
|
||||||
const step = detail.deltaY / height;
|
|
||||||
if (step < 0) { return; }
|
const step = clamp(0.0001, detail.deltaY / height, 0.9999);
|
||||||
|
|
||||||
const threshold = (detail.deltaY + velocity * 1000) / height;
|
const threshold = (detail.deltaY + velocity * 1000) / height;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user