1

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.

vukan
  • 191
  • 4
  • 12

1 Answers1

0

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

ng-click='angular.noop()'

no need for code above, or anything else.

vukan
  • 191
  • 4
  • 12