bug: $ionicScrollDelegate.scrollTo call with animate tr #165
Description
From @vrfurl on March 13, 2016 4:12
Type: bug
Ionic Version: 1.2.4
Platform: android 5.1 webview
When calling $ionicScrollDelegate.scrollBottom(true) the content is scrolled to the bottom however the element gains a new style element that looks like:
<ion-content style="overflow: hidden">
This causes the content of the scroll to become un scrollable. If the same call is make with animation false: $ionicScrollDelegate.scrollBottom(false) the content is scrolled to the bottom and the content is still scrollable as expected and no style="overflow: hidden" has been added to the ion-content dom element.
I believe the issue appears to be caused by the addition of code in ionic.js for method scrollTo
lines: 7194 to 7219
var oldOverflowX = self.el.style.overflowX;
var oldOverflowY = self.el.style.overflowY;
clearTimeout(self.__scrollToCleanupTimeout);
self.__scrollToCleanupTimeout = setTimeout(function() {
self.el.style.overflowX = oldOverflowX;
self.el.style.overflowY = oldOverflowY;
}, 500);
self.el.style.overflowY = 'hidden';
self.el.style.overflowX = 'hidden';
animateScroll(top, left);
function animateScroll(Y, X) {
// scroll animation loop w/ easing
// credit https://gist.github.com/dezinezync/5487119
var start = Date.now(),
duration = 250, //milliseconds
fromY = self.el.scrollTop,
fromX = self.el.scrollLeft;
if (fromY === Y && fromX === X) {
self.el.style.overflowX = oldOverflowX;
self.el.style.overflowY = oldOverflowY;
self.resize();
return; /* Prevent scrolling to the Y point if already there */
}
For whatever reason the overflow styles are not be reset to their old values....
Cordova CLI: 6.0.0
Ionic Version: 1.2.4
Ionic CLI Version: 1.7.14
Ionic App Lib Version: 0.7.0
OS: Windows 8.1
Node Version: v0.12.7
Copied from original issue: ionic-team/ionic-framework#5825