mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
fix(scrollView): start scroll again if it stops beyond boundaries
Addresses #482
This commit is contained in:
@@ -2024,17 +2024,23 @@ ionic.views.Scroll = ionic.views.View.inherit({
|
||||
|
||||
// Slow down until slow enough, then flip back to snap position
|
||||
if (scrollOutsideX !== 0) {
|
||||
if (scrollOutsideX * self.__decelerationVelocityX <= self.__minDecelerationScrollLeft) {
|
||||
var isHeadingOutwardsX = scrollOutsideX * self.__decelerationVelocityX <= self.__minDecelerationScrollLeft;
|
||||
if (isHeadingOutwardsX) {
|
||||
self.__decelerationVelocityX += scrollOutsideX * penetrationDeceleration;
|
||||
} else {
|
||||
}
|
||||
//If we're not heading outwards, or if the above statement got us below minDeceleration, go back towards bounds
|
||||
if (!isHeadingOutwardsX || self.__decelerationVelocityX <= self.__minDecelerationScrollLeft) {
|
||||
self.__decelerationVelocityX = scrollOutsideX * penetrationAcceleration;
|
||||
}
|
||||
}
|
||||
|
||||
if (scrollOutsideY !== 0) {
|
||||
if (scrollOutsideY * self.__decelerationVelocityY <= self.__minDecelerationScrollTop) {
|
||||
var isHeadingOutwardsY = scrollOutsideY * self.__decelerationVelocityY <= self.__minDecelerationScrollTop;
|
||||
if (isHeadingOutwardsY) {
|
||||
self.__decelerationVelocityY += scrollOutsideY * penetrationDeceleration;
|
||||
} else {
|
||||
}
|
||||
//If we're not heading outwards, or if the above statement got us below minDeceleration, go back towards bounds
|
||||
if (!isHeadingOutwardsY || self.__decelerationVelocityY <= self.__minDecelerationScrollTop) {
|
||||
self.__decelerationVelocityY = scrollOutsideY * penetrationAcceleration;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user