Select: fix filterable error with number-typed value

pull/2389/head
Leopoldthecoder 2017-01-13 12:38:54 +08:00
parent 9f94a28f43
commit 7f0525b15a
2 changed files with 6 additions and 2 deletions

View File

@ -114,7 +114,7 @@
queryChange(query) {
// query
let parsedQuery = query.replace(/(\^|\(|\)|\[|\]|\$|\*|\+|\.|\?|\\|\{|\}|\|)/g, '\\$1');
let parsedQuery = String(query).replace(/(\^|\(|\)|\[|\]|\$|\*|\+|\.|\?|\\|\{|\}|\|)/g, '\\$1');
this.visible = new RegExp(parsedQuery, 'i').test(this.currentLabel) || this.created;
if (!this.visible) {
this.parent.filteredOptionsCount--;

View File

@ -49,7 +49,7 @@
:disabled="disabled"
:readonly="!filterable || multiple"
:validate-event="false"
@focus="toggleMenu"
@focus="handleFocus"
@click="handleIconClick"
@mousedown.native="handleMouseDown"
@keyup.native="debouncedOnInputChange"
@ -403,6 +403,10 @@
});
},
handleFocus() {
this.visible = true;
},
handleIconClick(event) {
if (this.iconClass.indexOf('circle-close') > -1) {
this.deleteSelected(event);