Correct event propagation on transfer (fixes 3708 and 3695)

This commit is contained in:
Sergio Crisostomo 2018-05-29 14:10:07 +02:00
parent 743f6e0639
commit 5c846d28a6

View file

@ -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;