Skip to content

Commit 3d866a0

Browse files
committed
Revert "feat(scroll): disable body scroll on iOS safari"
This reverts commit 5875ebc.
1 parent 5875ebc commit 3d866a0

File tree

3 files changed

+5
-43
lines changed

3 files changed

+5
-43
lines changed

Diff for: js/angular/directive/content.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,7 @@ function($timeout, $controller, $ionicBind, $ionicConfig) {
132132
delegateHandle: attr.delegateHandle,
133133
startX: $scope.$eval($scope.startX) || 0,
134134
startY: $scope.$eval($scope.startY) || 0,
135-
nativeScrolling: true,
136-
disableBodyBounce: $ionicConfig.scrolling.disableBodyBounce()
135+
nativeScrolling: true
137136
};
138137

139138
} else {

Diff for: js/angular/service/ionicConfig.js

+4-10
Original file line numberDiff line numberDiff line change
@@ -260,8 +260,7 @@ IonicModule
260260
toggle: PLATFORM
261261
},
262262
scrolling: {
263-
jsScrolling: PLATFORM,
264-
disableBodyBounce: PLATFORM
263+
jsScrolling: PLATFORM
265264
},
266265
spinner: {
267266
icon: PLATFORM
@@ -310,8 +309,7 @@ IonicModule
310309
},
311310

312311
scrolling: {
313-
jsScrolling: false,
314-
disableBodyBounce: false
312+
jsScrolling: false
315313
},
316314

317315
spinner: {
@@ -326,18 +324,14 @@ IonicModule
326324
templates: {
327325
maxPrefetch: 30
328326
}
327+
329328
});
330329

331330

332331

333332
// iOS (it is the default already)
334333
// -------------------------
335-
setPlatformConfig('ios', {
336-
scrolling: {
337-
jsScrolling: false,
338-
disableBodyBounce: true
339-
}
340-
});
334+
setPlatformConfig('ios', {});
341335

342336

343337

Diff for: js/views/scrollViewNative.js

-31
Original file line numberDiff line numberDiff line change
@@ -441,26 +441,6 @@
441441
self.resize();
442442
};
443443

444-
var startY = 0;
445-
var curY = 0;
446-
var height = 0;
447-
self.handleWindowTouchStart = function(e) {
448-
startY = e.touches ? e.touches[0].screenY : e.screenY;
449-
height = self.el.offsetHeight;
450-
};
451-
452-
self.handleWindowTouchMove = function(e) {
453-
curY = e.touches ? e.touches[0].screenY : e.screenY;
454-
455-
var atTop = (startY <= curY && self.el.scrollTop === 0);
456-
var atBottom = (startY >= curY && self.el.scrollHeight - self.el.scrollTop === height);
457-
458-
if(atTop || atBottom) {
459-
// Disable body bounce
460-
e.preventDefault();
461-
}
462-
};
463-
464444
container.addEventListener('scroll', self.onScroll);
465445

466446
//Broadcasted when keyboard is shown on some platforms.
@@ -473,12 +453,6 @@
473453
// Since we can only resize scroll views that are currently visible, just resize
474454
// the current scroll view when the keyboard is closed.
475455
document.addEventListener('resetScrollView', self.resetScrollView);
476-
477-
if(self.options.disableBodyBounce && !ionic.Platform.isWebView()) {
478-
window.addEventListener('touchstart', self.handleWindowTouchStart);
479-
window.addEventListener('touchmove', self.handleWindowTouchMove);
480-
}
481-
482456
},
483457

484458
__cleanup: function() {
@@ -491,11 +465,6 @@
491465
container.removeEventListener('scrollChildIntoView', self.scrollChildIntoView);
492466
container.removeEventListener('resetScrollView', self.resetScrollView);
493467

494-
if(self.options.disableBodyBounce && !ionic.Platform.isWebView()) {
495-
window.removeEventListener('touchstart', self.handleWindowTouchStart);
496-
window.removeEventListener('touchmove', self.handleWindowTouchMove);
497-
}
498-
499468
ionic.tap.removeClonedInputs(container, self);
500469

501470
delete self.__container;

0 commit comments

Comments
 (0)