2
0
mirror of https://github.com/tenrok/vue-select.git synced 2026-05-17 02:29:37 +03:00

fix: create option not being called (#1158)

Closes #1156
This commit is contained in:
Jeff Sagal
2020-04-12 12:36:19 -07:00
committed by GitHub
parent 142a639444
commit f0e669c022
6 changed files with 88 additions and 35 deletions
+7 -4
View File
@@ -695,7 +695,7 @@
*/
onAfterSelect(option) {
if (this.closeOnSelect) {
this.open = !this.open
this.open = !this.open;
this.searchEl.blur()
}
@@ -1153,10 +1153,13 @@
}
let options = this.search.length ? this.filter(optionList, this.search, this) : optionList;
if (this.taggable && this.search.length && !this.optionExists(this.createOption(this.search))) {
options.unshift(this.search)
if (this.taggable && this.search.length) {
const createdOption = this.createOption(this.search);
if (!this.optionExists(createdOption)) {
options.unshift(createdOption);
}
}
return options
return options;
},
/**
-6
View File
@@ -61,12 +61,6 @@ export default {
if (typeAheadOption) {
this.select(typeAheadOption);
} else if (this.taggable && this.search.length) {
this.select(this.createOption(this.search));
}
if (this.clearSearchOnSelect) {
this.search = "";
}
}
}