Skip to content

Commit 2ad0250

Browse files
author
Damian Dulisz
committed
[2.0] Fix blur/focus and string includes
1 parent 1fc8079 commit 2ad0250

File tree

5 files changed

+12
-12
lines changed

5 files changed

+12
-12
lines changed

lib/multiselectMixin.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,8 @@ module.exports = {
177177
? this.options.filter(this.isNotSelected)
178178
: this.options
179179
options = this.label
180-
? options.filter((option) => option[this.label].indexOf(this.search) !== -1)
181-
: options.filter((option) => option.indexOf(this.search) !== -1)
180+
? options.filter((option) => option[this.label].includes(this.search))
181+
: options.filter((option) => option.includes(this.search))
182182
if (this.taggable && search.length && !this.isExistingOption(search)) {
183183
options.unshift({ isTag: true, label: search })
184184
}
@@ -367,7 +367,7 @@ module.exports = {
367367
/* istanbul ignore else */
368368
if (this.searchable) {
369369
this.search = ''
370-
this.$el.children[1].children[2].focus()
370+
this.$el.children[1].children[1].focus()
371371
} else {
372372
this.$el.focus()
373373
}
@@ -384,7 +384,7 @@ module.exports = {
384384
this.isOpen = false
385385
/* istanbul ignore else */
386386
if (this.searchable) {
387-
this.$el.children[1].children[2].blur()
387+
this.$el.children[1].children[1].blur()
388388
this.adjustSearch()
389389
} else {
390390
this.$el.blur()

lib/vue-multiselect.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/vue-multiselect.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-multiselect",
3-
"version": "2.0.0-beta.1",
3+
"version": "2.0.0-beta.2",
44
"description": "Multiselect component for vue.js",
55
"author": "Damian Dulisz <damian.dulisz@monterail.com>",
66
"private": false,

src/multiselectMixin.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,8 @@ module.exports = {
177177
? this.options.filter(this.isNotSelected)
178178
: this.options
179179
options = this.label
180-
? options.filter((option) => option[this.label].indexOf(this.search) !== -1)
181-
: options.filter((option) => option.indexOf(this.search) !== -1)
180+
? options.filter((option) => option[this.label].includes(this.search))
181+
: options.filter((option) => option.includes(this.search))
182182
if (this.taggable && search.length && !this.isExistingOption(search)) {
183183
options.unshift({ isTag: true, label: search })
184184
}
@@ -367,7 +367,7 @@ module.exports = {
367367
/* istanbul ignore else */
368368
if (this.searchable) {
369369
this.search = ''
370-
this.$el.children[1].children[2].focus()
370+
this.$el.children[1].children[1].focus()
371371
} else {
372372
this.$el.focus()
373373
}
@@ -384,7 +384,7 @@ module.exports = {
384384
this.isOpen = false
385385
/* istanbul ignore else */
386386
if (this.searchable) {
387-
this.$el.children[1].children[2].blur()
387+
this.$el.children[1].children[1].blur()
388388
this.adjustSearch()
389389
} else {
390390
this.$el.blur()

0 commit comments

Comments
 (0)