mirror of https://github.com/ElemeFE/element
Merge pull request #2389 from Leopoldthecoder/select
Select: fix filterable error with number-typed valuepull/2395/head
commit
bee6c5bd89
|
@ -114,7 +114,7 @@
|
||||||
|
|
||||||
queryChange(query) {
|
queryChange(query) {
|
||||||
// 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;
|
this.visible = new RegExp(parsedQuery, 'i').test(this.currentLabel) || this.created;
|
||||||
if (!this.visible) {
|
if (!this.visible) {
|
||||||
this.parent.filteredOptionsCount--;
|
this.parent.filteredOptionsCount--;
|
||||||
|
|
|
@ -49,7 +49,7 @@
|
||||||
:disabled="disabled"
|
:disabled="disabled"
|
||||||
:readonly="!filterable || multiple"
|
:readonly="!filterable || multiple"
|
||||||
:validate-event="false"
|
:validate-event="false"
|
||||||
@focus="toggleMenu"
|
@focus="handleFocus"
|
||||||
@click="handleIconClick"
|
@click="handleIconClick"
|
||||||
@mousedown.native="handleMouseDown"
|
@mousedown.native="handleMouseDown"
|
||||||
@keyup.native="debouncedOnInputChange"
|
@keyup.native="debouncedOnInputChange"
|
||||||
|
@ -403,6 +403,10 @@
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
handleFocus() {
|
||||||
|
this.visible = true;
|
||||||
|
},
|
||||||
|
|
||||||
handleIconClick(event) {
|
handleIconClick(event) {
|
||||||
if (this.iconClass.indexOf('circle-close') > -1) {
|
if (this.iconClass.indexOf('circle-close') > -1) {
|
||||||
this.deleteSelected(event);
|
this.deleteSelected(event);
|
||||||
|
|
Loading…
Reference in New Issue