Skip to content

Commit

Permalink
Merge pull request #5 from ladadeedee/master
Browse files Browse the repository at this point in the history
Updates to keyboard events
  • Loading branch information
btecu authored Dec 12, 2016
2 parents 2161f7a + 3bfeb19 commit d766028
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
5 changes: 2 additions & 3 deletions addon/components/select-dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,8 @@ export default Component.extend({
tabEnterKeys(selected) {
if (selected && this.get('options').includes(selected)) {
this.send('select', selected);
} else {
let token = this.get('freeText') ? this.get('token') : '';
this.attrs.select(token);
} else if (this.get('freeText')) {
this.attrs.select(this.get('token'));
}
},

Expand Down
6 changes: 5 additions & 1 deletion addon/components/x-select.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,11 @@ export default Component.extend({

break;
case 27: // ESC
this.send('clear');
if (this.get('canSearch') && this.get('hasInput')) {
this.send('clear');
} else {
this.set('isOpen', false);
}
break;
case 38: // Up Arrow
case 40: // Down Arrow
Expand Down

0 comments on commit d766028

Please sign in to comment.