File tree Expand file tree Collapse file tree 2 files changed +27
-7
lines changed Expand file tree Collapse file tree 2 files changed +27
-7
lines changed Original file line number Diff line number Diff line change 9
9
<!--<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet">-->
10
10
<!--<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0/css/bootstrap.min.css">-->
11
11
< style >
12
-
12
+
13
13
# app {
14
14
height : 95vh ;
15
15
display : flex;
68
68
</ span >
69
69
</ v-select >
70
70
71
+ < v-select placeholder ="select on tab " :select-on-tab ="true " :options ="options "> </ v-select >
71
72
< v-select placeholder ="disabled " disabled value ="disabled "> </ v-select >
72
73
< v-select placeholder ="disabled multiple " disabled multiple :value ="['disabled', 'multiple'] "> </ v-select >
73
74
< v-select placeholder ="filterable=false, @search=searchPeople " label ="first_name " :filterable ="false " @search ="searchPeople " :options ="people "> </ v-select >
Original file line number Diff line number Diff line change 329
329
v-model =" search"
330
330
@keydown.delete =" maybeDeleteValue"
331
331
@keyup.esc =" onEscape"
332
+ @keydown.tab =" onTab"
332
333
@keydown.up.prevent =" typeAheadUp"
333
334
@keydown.down.prevent =" typeAheadDown"
334
335
@keydown.enter.prevent =" typeAheadSelect"
346
347
aria-label =" Search for option"
347
348
>
348
349
349
- <button
350
- v-show =" showClearButton"
351
- :disabled =" disabled"
350
+ <button
351
+ v-show =" showClearButton"
352
+ :disabled =" disabled"
352
353
@click =" clearSelection"
353
- type =" button"
354
- class =" clear"
355
- title =" Clear selection"
354
+ type =" button"
355
+ class =" clear"
356
+ title =" Clear selection"
356
357
>
357
358
<span aria-hidden =" true" >× ; </span >
358
359
</button >
680
681
type: String ,
681
682
default: ' auto'
682
683
},
684
+ /**
685
+ * When true, hitting the 'tab' key will select the current select value
686
+ * @type {Boolean}
687
+ */
688
+ selectOnTab: {
689
+ type: Boolean ,
690
+ default: false
691
+ }
683
692
},
684
693
685
694
data () {
918
927
}
919
928
},
920
929
930
+ /**
931
+ * Select the current value if selectOnTab is enabled
932
+ * @return {void}
933
+ */
934
+ onTab () {
935
+ if (this .selectOnTab ) {
936
+ this .typeAheadSelect ();
937
+ }
938
+ },
939
+
921
940
/**
922
941
* Determine if an option exists
923
942
* within this.mutableOptions array.
You can’t perform that action at this time.
0 commit comments