Updated datepicker close handling

Updated datepicker to close on blur or on the keypress of the escape key.