Skip to content

Commit

Permalink
Merge pull request #37 from cognitoforms/tab-selects-option
Browse files Browse the repository at this point in the history
feat: tab key selects option and closes picker to mirror native select
  • Loading branch information
mattheyan authored Jul 17, 2020
2 parents 87e3e22 + 81531a4 commit 5bbc49c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/select/src/select.vue
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
@keydown.enter.prevent="selectOption"
@keydown.esc.stop.prevent="visible = false"
@keydown.delete="deletePrevTag"
@keydown.tab="visible = false"
@keydown.tab="handleTabKey"
@compositionstart="handleComposition"
@compositionupdate="handleComposition"
@compositionend="handleComposition"
Expand Down Expand Up @@ -540,6 +540,10 @@
},
handleTabKey(e) {
if (this.visible) {
e.preventDefault();
}
this.selectOption(e);
this.visible = false;
},
Expand Down

0 comments on commit 5bbc49c

Please sign in to comment.