Skip to content

Commit 9a0d7aa

Browse files
author
Damian Dulisz
authored
Merge pull request #37 from asvae/null-search-fix
Null selected on taggable throws exception.
2 parents 899ea4f + cb494c5 commit 9a0d7aa

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/multiselectMixin.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -241,12 +241,13 @@ module.exports = {
241241
},
242242
computed: {
243243
filteredOptions () {
244+
let search = this.search ? this.search : ''
244245
var options = this.hideSelected
245246
? this.options.filter(this.isNotSelected)
246247
: this.options
247-
options = this.$options.filters.filterBy(options, this.search)
248-
if (this.taggable && this.search.length > 0 && !this.isExistingOption(this.search)) {
249-
options.unshift({ isTag: true, label: this.search })
248+
options = this.$options.filters.filterBy(options, search)
249+
if (this.taggable && search.length > 0 && !this.isExistingOption(search)) {
250+
options.unshift({ isTag: true, label: search })
250251
}
251252
return options
252253
},

0 commit comments

Comments
 (0)