mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
fix(keyboard): improve keyboard scroll assist
This commit is contained in:
@@ -49,17 +49,16 @@ export class ScrollTo {
|
||||
}
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
|
||||
let start = Date.now();
|
||||
let start;
|
||||
|
||||
// start scroll loop
|
||||
self.isPlaying = true;
|
||||
raf(step);
|
||||
|
||||
// decelerating to zero velocity
|
||||
function easeOutCubic(t) {
|
||||
return (--t) * t * t + 1;
|
||||
}
|
||||
// chill out for a frame first
|
||||
raf(() => {
|
||||
start = Date.now();
|
||||
raf(step);
|
||||
});
|
||||
|
||||
// scroll loop
|
||||
function step() {
|
||||
@@ -104,3 +103,8 @@ export class ScrollTo {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// decelerating to zero velocity
|
||||
function easeOutCubic(t) {
|
||||
return (--t) * t * t + 1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user