From 5c846d28a6a7a7badff32d2e2af7316804b438ad Mon Sep 17 00:00:00 2001 From: Sergio Crisostomo Date: Tue, 29 May 2018 14:10:07 +0200 Subject: [PATCH] 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 f668b42..d3d4151 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; -- libgit2 0.21.4