From 743f6e0639f67f1c5d61234ee76e311a3dd159e9 Mon Sep 17 00:00:00 2001 From: Sergio Crisostomo Date: Tue, 29 May 2018 12:40:21 +0200 Subject: [PATCH 1/3] Be more hard on the reset --- src/components/select/select.vue | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/select/select.vue b/src/components/select/select.vue index ea1f5d14..f668b425 100644 --- a/src/components/select/select.vue +++ b/src/components/select/select.vue @@ -411,7 +411,7 @@ clearSingleSelect(){ // PUBLIC API this.$emit('on-clear'); this.hideMenu(); - if (this.clearable) this.values = []; + if (this.clearable) this.reset(); }, getOptionData(value){ const option = this.flatOptions.find(({componentOptions}) => componentOptions.propsData.value === value); @@ -507,6 +507,8 @@ } }, reset(){ + this.query = ''; + this.focusIndex = -1; this.unchangedQuery = true; this.values = []; }, From 5c846d28a6a7a7badff32d2e2af7316804b438ad Mon Sep 17 00:00:00 2001 From: Sergio Crisostomo Date: Tue, 29 May 2018 14:10:07 +0200 Subject: [PATCH 2/3] Correct event propagation on transfer (fixes 3708 and 3695) --- src/components/select/select.vue | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/components/select/select.vue b/src/components/select/select.vue index f668b425..d3d41512 100644 --- a/src/components/select/select.vue +++ b/src/components/select/select.vue @@ -427,7 +427,7 @@ let initialValue = Array.isArray(value) ? value : [value]; if (!multiple && (typeof initialValue[0] === 'undefined' || (String(initialValue[0]).trim() === '' && !Number.isFinite(initialValue[0])))) initialValue = []; return initialValue.filter((item) => { - return Boolean(item) || item === 0 + return Boolean(item) || item === 0; }); }, processOption(option, values, isFocused){ @@ -488,6 +488,14 @@ return; } + if (this.transfer) { + const {$el} = this.$refs.dropdown; + if ($el === event.target || $el.contains(event.target)) { + return; + } + } + + if (this.filterable) { const input = this.$el.querySelector('input[type="text"]'); this.caretPosition = input.selectionStart; From d20b4e1a73a05029a5125bb320a6e4a062b6552e Mon Sep 17 00:00:00 2001 From: Sergio Crisostomo Date: Tue, 29 May 2018 15:06:50 +0200 Subject: [PATCH 3/3] detect touched so touch devices can also be selected --- src/components/select/option.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/select/option.vue b/src/components/select/option.vue index 59e080f4..86c1add0 100644 --- a/src/components/select/option.vue +++ b/src/components/select/option.vue @@ -2,6 +2,7 @@
  • {{ showLabel }}