Skip to content

Commit 63b0a31

Browse files
committed
refactor(scrollView): restart scroll if stopped, + or -
Addresses #482
1 parent 82c2089 commit 63b0a31

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

js/views/scrollView.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2028,8 +2028,9 @@ ionic.views.Scroll = ionic.views.View.inherit({
20282028
if (isHeadingOutwardsX) {
20292029
self.__decelerationVelocityX += scrollOutsideX * penetrationDeceleration;
20302030
}
2031+
var isStoppedX = Math.abs(self.__decelerationVelocityX) <= self.__minDecelerationScrollLeft;
20312032
//If we're not heading outwards, or if the above statement got us below minDeceleration, go back towards bounds
2032-
if (!isHeadingOutwardsX || self.__decelerationVelocityX <= self.__minDecelerationScrollLeft) {
2033+
if (!isHeadingOutwardsX || isStoppedX) {
20332034
self.__decelerationVelocityX = scrollOutsideX * penetrationAcceleration;
20342035
}
20352036
}
@@ -2039,8 +2040,9 @@ ionic.views.Scroll = ionic.views.View.inherit({
20392040
if (isHeadingOutwardsY) {
20402041
self.__decelerationVelocityY += scrollOutsideY * penetrationDeceleration;
20412042
}
2043+
var isStoppedY = Math.abs(self.__decelerationVelocityY) <= self.__minDecelerationScrollTop;
20422044
//If we're not heading outwards, or if the above statement got us below minDeceleration, go back towards bounds
2043-
if (!isHeadingOutwardsY || self.__decelerationVelocityY <= self.__minDecelerationScrollTop) {
2045+
if (!isHeadingOutwardsY || isStoppedY) {
20442046
self.__decelerationVelocityY = scrollOutsideY * penetrationAcceleration;
20452047
}
20462048
}

0 commit comments

Comments
 (0)