From cacacfc5a8bbc0f0ca3ba0614f80382c0729fe74 Mon Sep 17 00:00:00 2001 From: Marek Meyer Date: Sat, 17 Nov 2018 11:45:57 +0100 Subject: [PATCH] Improved fix for unresponsive vue-select after clicking custom no-options to not reintroduce old IE bug (#703) --- src/components/Select.vue | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/src/components/Select.vue b/src/components/Select.vue index 37ec3d5..ffdcb54 100644 --- a/src/components/Select.vue +++ b/src/components/Select.vue @@ -969,11 +969,29 @@ * @return {void} */ onSearchBlur() { - - this.mousedown = false - if (this.clearSearchOnBlur) { - this.search = '' + + if (this.mousedown && !this.searching) { + this.mousedown = false + } else { + if (this.clearSearchOnBlur) { + this.search = '' + } + this.closeSearchOptions() } + + // Fixed bug where no-options message could not be closed + if(this.search.length === 0 && this.options.length === 0){ + this.closeSearchOptions() + } + + }, + + /** + * 'Private' function to close the search options + * @emits {search:blur} + * @returns {void} + */ + closeSearchOptions(){ this.open = false this.$emit('search:blur') },