Skip to content

Commit

Permalink
Do not parse time on space
Browse files Browse the repository at this point in the history
  • Loading branch information
Francesco Novy committed Nov 28, 2017
1 parent 124c023 commit 4397e1c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions addon/components/time-picker.js
Original file line number Diff line number Diff line change
Expand Up @@ -628,10 +628,14 @@ export default Component.extend({
let { keyCode } = event;
let enterKeyCode = 13;
let tabKeyCode = 9;
let spaceKeyCode = 32;
if (keyCode === enterKeyCode || keyCode === tabKeyCode) {
this.send('selectCurrent');
return false;
}
if (keyCode === spaceKeyCode) {
return false;
}
}
}
});
2 changes: 1 addition & 1 deletion addon/utils/parse-time.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export function parseTime(value) {
}

// Moment.js objects are handled directly.
if (typeof value === 'object' && typeof value.format === 'function') {
if (moment.isMoment(value)) {
return value;
}

Expand Down

0 comments on commit 4397e1c

Please sign in to comment.