1 files changed, 6 insertions, 1 deletions
diff --git a/webclient/app-directive.js b/webclient/app-directive.js
index 01f60fdadf..eee0d3842f 100644
--- a/webclient/app-directive.js
+++ b/webclient/app-directive.js
@@ -32,7 +32,12 @@ angular.module('matrixWebClient')
.directive('ngFocus', ['$timeout', function($timeout) {
return {
link: function(scope, element, attr) {
- $timeout(function() { element[0].focus(); }, 0);
+ // XXX: slightly evil hack to disable autofocus on iOS, as in general
+ // it causes more problems than it fixes, by bouncing the page
+ // around
+ if (!/(iPad|iPhone|iPod)/g.test(navigator.userAgent)) {
+ $timeout(function() { element[0].focus(); }, 0);
+ }
}
};
}]);
\ No newline at end of file
|