mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-08 23:58:13 +08:00
fix(ios): clamp out of bounds values for swipe to go back (#20540)
fixes #20505
This commit is contained in:
@ -1,3 +1,5 @@
|
|||||||
|
import { clamp } from '../helpers';
|
||||||
|
|
||||||
import { Gesture, GestureDetail, createGesture } from './index';
|
import { Gesture, GestureDetail, createGesture } from './index';
|
||||||
|
|
||||||
export const createSwipeBackGesture = (
|
export const createSwipeBackGesture = (
|
||||||
@ -38,12 +40,11 @@ export const createSwipeBackGesture = (
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO: stepValue can sometimes return a negative
|
* TODO: stepValue can sometimes return negative values
|
||||||
* value, but you can't have a negative time value
|
* or values greater than 1 which should not be possible.
|
||||||
* for the cubic bezier curve (at least with web animations)
|
* Need to investigate more to find where the issue is.
|
||||||
* Not sure if the negative step value is an error or not
|
|
||||||
*/
|
*/
|
||||||
onEndHandler(shouldComplete, (stepValue <= 0) ? 0.01 : stepValue, realDur);
|
onEndHandler(shouldComplete, (stepValue <= 0) ? 0.01 : clamp(0, stepValue, 0.9999), realDur);
|
||||||
};
|
};
|
||||||
|
|
||||||
return createGesture({
|
return createGesture({
|
||||||
|
|||||||
Reference in New Issue
Block a user