-
Couldn't load subscription status.
- Fork 3.2k
Closed
Labels
contentIssues related to the contents of the documentation websiteIssues related to the contents of the documentation website
Description
URL
https://ionicframework.com/docs/utilities/animations#gesture-animations
What is missing or inaccurate about the content on this page?
First issue
Current doc for Javascript and Angular tabs
const gesture = createGesture({
el: square,
threshold: 0,
gestureName: 'square-drag',
onMove: ev: onMove(ev),
onEnd: ev: onEnd(ev)
})
onMove and onEnd should look like this
onMove: ev => onMove(ev),
onEnd: ev => onEnd(ev)
Second issue in the same code snippet
const onMove = (ev): {
if (!started) {
animation.progressStart();
started = true;
}
animation.progressStep(getStep(ev));
}
progressStart() requires a bool argument
Third issue in the same code snippet
The onEnd method for Javascript and Angular
const onEnd = (ev): {
if (!started) { return; }
gesture.enable(false);
const step = getStep(ev);
const shouldComplete = step > 0.5;
animation
.progressEnd((shouldComplete) ? 1 : 0, step)
.onFinish((): { gesture.enable(true); });
initialStep = (shouldComplete) ? MAX_TRANSLATE : 0;
started = false;
}
This is incorrect because the progressEnd typescript definition returns void so you cannot chain onFinish()
progressEnd(playTo: 0 | 1 | undefined, step: number, dur?: number): void;
Secondly, onFinish should look like this
.onFinish(() => { gesture.enable(true); });
Metadata
Metadata
Assignees
Labels
contentIssues related to the contents of the documentation websiteIssues related to the contents of the documentation website