Created
January 26, 2015 18:44
-
-
Save griiettner/bf9c83b5a222a005c63e to your computer and use it in GitHub Desktop.
Hide iPad keyboard Angular version
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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