File tree Expand file tree Collapse file tree 1 file changed +28
-4
lines changed Expand file tree Collapse file tree 1 file changed +28
-4
lines changed Original file line number Diff line number Diff line change 191
191
@keydown.up.prevent =" typeAheadUp"
192
192
@keydown.down.prevent =" typeAheadDown"
193
193
@keyup.enter.prevent =" typeAheadSelect"
194
- @blur =" open = false "
195
- @focus =" open = true "
194
+ @blur =" onSearchBlur "
195
+ @focus =" onSearchFocus "
196
196
type =" search"
197
197
class =" form-control"
198
198
:placeholder =" searchPlaceholder"
382
382
*/
383
383
createOption: {
384
384
type: Function ,
385
- default : function (newOption ) {
385
+ default (newOption ) {
386
386
if (typeof this .mutableOptions [0 ] === ' object' ) {
387
387
newOption = {[this .label ]: newOption}
388
388
}
400
400
default: false
401
401
},
402
402
403
+ /**
404
+ * Disable the dropdown entirely.
405
+ * @type {Boolean}
406
+ */
403
407
noDrop: {
404
408
type: Boolean ,
405
409
default: false
591
595
/**
592
596
* If there is any text in the search input, remove it.
593
597
* Otherwise, blur the search input to close the dropdown.
594
- * @return {[type]} [description]
598
+ * @return {void}
595
599
*/
596
600
onEscape () {
597
601
if (! this .search .length ) {
601
605
}
602
606
},
603
607
608
+ /**
609
+ * Close the dropdown on blur.
610
+ * @emits {search:blur}
611
+ * @return {void}
612
+ */
613
+ onSearchBlur () {
614
+ this .open = false
615
+ this .$emit (' search:blur' )
616
+ },
617
+
618
+ /**
619
+ * Open the dropdown on focus.
620
+ * @emits {search:focus}
621
+ * @return {void}
622
+ */
623
+ onSearchFocus () {
624
+ this .open = true
625
+ this .$emit (' search:focus' )
626
+ },
627
+
604
628
/**
605
629
* Delete the value on Delete keypress when there is no
606
630
* text in the search input, & there's tags to delete
You can’t perform that action at this time.
0 commit comments