Hide the iOS soft keyboard AngularJS

1.2k Views Asked by At

I need to close soft keyboard on iOS simply clicking outside of input field in Angular app.

I found part of solution:

    $scope.hideKeyboard = function() {
     document.activeElement.blur();
     var inputs = document.querySelectorAll('input');
     for(var i=0; i < inputs.length; i++) {
      inputs[i].blur();
     }
    }; 

<input type='text' ... ng-blur='hideKeyboard()' />

but ng-blur does not help me.

something like this doesn't work.

1

There are 1 best solutions below

0
vukan On

Found easy solution. On top level div (root of project) I added:

ng-click='angular.noop()'

no need for code above, or anything else.