Skip to content

Commit

Permalink
fix(md-datepicker): Erase via backspace would not update value or cle…
Browse files Browse the repository at this point in the history
…ar it
  • Loading branch information
acamilleri committed Jul 12, 2016
1 parent b8d678d commit 8e748ce
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/datepicker/datepicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export class MdDatePicker {
this.picker.set('select', this.value);
}
if (this.options && this.options.editable) {
$(this.element).on('keypress', (e)=> {
$(this.element).on('keydown', (e)=> {
if (e.keyCode === 13) {
let rawDate = $(this.element).val();
if (rawDate) {
Expand All @@ -86,6 +86,8 @@ export class MdDatePicker {
} else {
this.openDatePicker();
}
}else{
this.value = null;
}
});
} else {
Expand Down

0 comments on commit 8e748ce

Please sign in to comment.