Commit 5c846d28a6a7a7badff32d2e2af7316804b438ad
1 parent
743f6e06
Correct event propagation on transfer (fixes 3708 and 3695)
Showing
1 changed file
with
9 additions
and
1 deletions
Show diff stats
src/components/select/select.vue
@@ -427,7 +427,7 @@ | @@ -427,7 +427,7 @@ | ||
427 | let initialValue = Array.isArray(value) ? value : [value]; | 427 | let initialValue = Array.isArray(value) ? value : [value]; |
428 | if (!multiple && (typeof initialValue[0] === 'undefined' || (String(initialValue[0]).trim() === '' && !Number.isFinite(initialValue[0])))) initialValue = []; | 428 | if (!multiple && (typeof initialValue[0] === 'undefined' || (String(initialValue[0]).trim() === '' && !Number.isFinite(initialValue[0])))) initialValue = []; |
429 | return initialValue.filter((item) => { | 429 | return initialValue.filter((item) => { |
430 | - return Boolean(item) || item === 0 | 430 | + return Boolean(item) || item === 0; |
431 | }); | 431 | }); |
432 | }, | 432 | }, |
433 | processOption(option, values, isFocused){ | 433 | processOption(option, values, isFocused){ |
@@ -488,6 +488,14 @@ | @@ -488,6 +488,14 @@ | ||
488 | return; | 488 | return; |
489 | } | 489 | } |
490 | 490 | ||
491 | + if (this.transfer) { | ||
492 | + const {$el} = this.$refs.dropdown; | ||
493 | + if ($el === event.target || $el.contains(event.target)) { | ||
494 | + return; | ||
495 | + } | ||
496 | + } | ||
497 | + | ||
498 | + | ||
491 | if (this.filterable) { | 499 | if (this.filterable) { |
492 | const input = this.$el.querySelector('input[type="text"]'); | 500 | const input = this.$el.querySelector('input[type="text"]'); |
493 | this.caretPosition = input.selectionStart; | 501 | this.caretPosition = input.selectionStart; |