mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
fix(scrollView): always stay exactly within boundaries after bounce
Closes #1736
This commit is contained in:
@@ -2118,6 +2118,16 @@ ionic.views.Scroll = ionic.views.View.inherit({
|
||||
Math.abs(self.__decelerationVelocityY) >= self.__minVelocityToKeepDecelerating;
|
||||
if (!shouldContinue) {
|
||||
self.__didDecelerationComplete = true;
|
||||
|
||||
//Make sure the scroll values are within the boundaries after a bounce,
|
||||
//not below 0 or above maximum
|
||||
if (self.options.bouncing) {
|
||||
self.scrollTo(
|
||||
Math.min( Math.max(self.__scrollLeft, 0), self.__maxScrollLeft ),
|
||||
Math.min( Math.max(self.__scrollTop, 0), self.__maxScrollTop ),
|
||||
false
|
||||
);
|
||||
}
|
||||
}
|
||||
return shouldContinue;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user