only dismiss keyboard when the field is empty and user pressed back