Skip to content

Commit

Permalink
#6256 bug fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
mo.duan committed Sep 11, 2019
1 parent 4911571 commit 47c239d
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/components/select/select.vue
Original file line number Diff line number Diff line change
Expand Up @@ -558,31 +558,32 @@
this.filterQueryChange = false;
},
handleKeydown (e) {
if (e.key === 'Backspace'){
const key = e.key || e.code;
if ( key === 'Backspace'){
return; // so we don't call preventDefault
}
if (this.visible) {
e.preventDefault();
if (e.key === 'Tab'){
if ( key === 'Tab'){
e.stopPropagation();
}
// Esc slide-up
if (e.key === 'Escape') {
if ( key === 'Escape') {
e.stopPropagation();
this.hideMenu();
}
// next
if (e.key === 'ArrowUp') {
if ( key === 'ArrowUp') {
this.navigateOptions(-1);
}
// prev
if (e.key === 'ArrowDown') {
if ( key === 'ArrowDown') {
this.navigateOptions(1);
}
// enter
if (e.key === 'Enter') {
if ( key === 'Enter') {
if (this.focusIndex === -1) return this.hideMenu();
const optionComponent = this.flatOptions[this.focusIndex];
Expand Down

0 comments on commit 47c239d

Please sign in to comment.