Skip to content

Commit cacacfc

Browse files
committed
Improved fix for unresponsive vue-select after clicking custom no-options to not reintroduce old IE bug (sagalbot#703)
1 parent 17c06c0 commit cacacfc

File tree

1 file changed

+22
-4
lines changed

1 file changed

+22
-4
lines changed

src/components/Select.vue

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -969,11 +969,29 @@
969969
* @return {void}
970970
*/
971971
onSearchBlur() {
972-
973-
this.mousedown = false
974-
if (this.clearSearchOnBlur) {
975-
this.search = ''
972+
973+
if (this.mousedown && !this.searching) {
974+
this.mousedown = false
975+
} else {
976+
if (this.clearSearchOnBlur) {
977+
this.search = ''
978+
}
979+
this.closeSearchOptions()
980+
}
981+
982+
// Fixed bug where no-options message could not be closed
983+
if(this.search.length === 0 && this.options.length === 0){
984+
this.closeSearchOptions()
976985
}
986+
987+
},
988+
989+
/**
990+
* 'Private' function to close the search options
991+
* @emits {search:blur}
992+
* @returns {void}
993+
*/
994+
closeSearchOptions(){
977995
this.open = false
978996
this.$emit('search:blur')
979997
},

0 commit comments

Comments
 (0)