Fixed bug to dismiss keyboard when text field is not active.