mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-09 16:16: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 step = detail.deltaY / height;
|
||||
if (step < 0) { return; }
|
||||
const step = clamp(0.0001, detail.deltaY / height, 0.9999);
|
||||
|
||||
animation.progressStep(step);
|
||||
};
|
||||
|
||||
const onEnd = (detail: GestureDetail) => {
|
||||
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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user