Dismisses or hides keyboard with delegation