Skip to content

Commit 1c789f8

Browse files
committed
fix(scrollView): always stay exactly within boundaries after bounce
Closes #1736
1 parent d5d38bb commit 1c789f8

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

js/views/scrollView.js

+10
Original file line numberDiff line numberDiff line change
@@ -2118,6 +2118,16 @@ ionic.views.Scroll = ionic.views.View.inherit({
21182118
Math.abs(self.__decelerationVelocityY) >= self.__minVelocityToKeepDecelerating;
21192119
if (!shouldContinue) {
21202120
self.__didDecelerationComplete = true;
2121+
2122+
//Make sure the scroll values are within the boundaries after a bounce,
2123+
//not below 0 or above maximum
2124+
if (self.options.bouncing) {
2125+
self.scrollTo(
2126+
Math.min( Math.max(self.__scrollLeft, 0), self.__maxScrollLeft ),
2127+
Math.min( Math.max(self.__scrollTop, 0), self.__maxScrollTop ),
2128+
false
2129+
);
2130+
}
21212131
}
21222132
return shouldContinue;
21232133
};

0 commit comments

Comments
 (0)