Skip to content

Instantly share code, notes, and snippets.

@griiettner
Created January 26, 2015 18:44
Show Gist options
  • Save griiettner/bf9c83b5a222a005c63e to your computer and use it in GitHub Desktop.
Save griiettner/bf9c83b5a222a005c63e to your computer and use it in GitHub Desktop.
Hide iPad keyboard Angular version
$scope.hideKeyboard = function() {
document.activeElement.blur();
var inputs = document.querySelectorAll('input');
for(var i=0; i < inputs.length; i++) {
inputs[i].blur();
}
};
// Thanks to:
// http://uihacker.blogspot.com/2011/10/javascript-hide-ios-soft-keyboard.html
<form ng-submit="hideKeyboard()">
<label for="territory">Input a Territory ID:</label>
<input type="text">
<button type="submit">Search</button>
</form>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment