mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
fix(scroll): calling ionic scroll methods blur any selected input elements. Closes #2244
This commit is contained in:
8
js/angular/controller/scrollController.js
vendored
8
js/angular/controller/scrollController.js
vendored
@@ -134,12 +134,14 @@ function($scope, scrollViewOptions, $timeout, $window, $$scrollValueCache, $loca
|
||||
};
|
||||
|
||||
this.scrollTop = function(shouldAnimate) {
|
||||
ionic.DomUtil.blurAll();
|
||||
this.resize().then(function() {
|
||||
scrollView.scrollTo(0, 0, !!shouldAnimate);
|
||||
});
|
||||
};
|
||||
|
||||
this.scrollBottom = function(shouldAnimate) {
|
||||
ionic.DomUtil.blurAll();
|
||||
this.resize().then(function() {
|
||||
var max = scrollView.getScrollMax();
|
||||
scrollView.scrollTo(max.left, max.top, !!shouldAnimate);
|
||||
@@ -147,30 +149,35 @@ function($scope, scrollViewOptions, $timeout, $window, $$scrollValueCache, $loca
|
||||
};
|
||||
|
||||
this.scrollTo = function(left, top, shouldAnimate) {
|
||||
ionic.DomUtil.blurAll();
|
||||
this.resize().then(function() {
|
||||
scrollView.scrollTo(left, top, !!shouldAnimate);
|
||||
});
|
||||
};
|
||||
|
||||
this.zoomTo = function(zoom, shouldAnimate, originLeft, originTop) {
|
||||
ionic.DomUtil.blurAll();
|
||||
this.resize().then(function() {
|
||||
scrollView.zoomTo(zoom, !!shouldAnimate, originLeft, originTop);
|
||||
});
|
||||
};
|
||||
|
||||
this.zoomBy = function(zoom, shouldAnimate, originLeft, originTop) {
|
||||
ionic.DomUtil.blurAll();
|
||||
this.resize().then(function() {
|
||||
scrollView.zoomBy(zoom, !!shouldAnimate, originLeft, originTop);
|
||||
});
|
||||
};
|
||||
|
||||
this.scrollBy = function(left, top, shouldAnimate) {
|
||||
ionic.DomUtil.blurAll();
|
||||
this.resize().then(function() {
|
||||
scrollView.scrollBy(left, top, !!shouldAnimate);
|
||||
});
|
||||
};
|
||||
|
||||
this.anchorScroll = function(shouldAnimate) {
|
||||
ionic.DomUtil.blurAll();
|
||||
this.resize().then(function() {
|
||||
var hash = $location.hash();
|
||||
var elm = hash && $document[0].getElementById(hash);
|
||||
@@ -201,6 +208,7 @@ function($scope, scrollViewOptions, $timeout, $window, $$scrollValueCache, $loca
|
||||
this._rememberScrollId = null;
|
||||
};
|
||||
this.scrollToRememberedPosition = function(shouldAnimate) {
|
||||
ionic.DomUtil.blurAll();
|
||||
var values = $$scrollValueCache[this._rememberScrollId];
|
||||
if (values) {
|
||||
this.resize().then(function() {
|
||||
|
||||
Reference in New Issue
Block a user