mirror of https://github.com/ElemeFE/element
Select: focusing does not show popper (#9894)
parent
95d2eabd5e
commit
5f75ab8375
|
@ -2,11 +2,11 @@
|
||||||
<div
|
<div
|
||||||
class="el-select"
|
class="el-select"
|
||||||
:class="[selectSize ? 'el-select--' + selectSize : '']"
|
:class="[selectSize ? 'el-select--' + selectSize : '']"
|
||||||
|
@click.stop="toggleMenu"
|
||||||
v-clickoutside="handleClose">
|
v-clickoutside="handleClose">
|
||||||
<div
|
<div
|
||||||
class="el-select__tags"
|
class="el-select__tags"
|
||||||
v-if="multiple"
|
v-if="multiple"
|
||||||
@click.stop="toggleMenu"
|
|
||||||
ref="tags"
|
ref="tags"
|
||||||
:style="{ 'max-width': inputWidth - 32 + 'px' }">
|
:style="{ 'max-width': inputWidth - 32 + 'px' }">
|
||||||
<span v-if="collapseTags && selected.length">
|
<span v-if="collapseTags && selected.length">
|
||||||
|
@ -79,7 +79,6 @@
|
||||||
:class="{ 'is-focus': visible }"
|
:class="{ 'is-focus': visible }"
|
||||||
@focus="handleFocus"
|
@focus="handleFocus"
|
||||||
@blur="handleBlur"
|
@blur="handleBlur"
|
||||||
@mousedown.native="handleMouseDown"
|
|
||||||
@keyup.native="debouncedOnInputChange"
|
@keyup.native="debouncedOnInputChange"
|
||||||
@keydown.native.down.stop.prevent="navigateOptions('next')"
|
@keydown.native.down.stop.prevent="navigateOptions('next')"
|
||||||
@keydown.native.up.stop.prevent="navigateOptions('prev')"
|
@keydown.native.up.stop.prevent="navigateOptions('prev')"
|
||||||
|
@ -520,7 +519,6 @@
|
||||||
},
|
},
|
||||||
|
|
||||||
handleFocus(event) {
|
handleFocus(event) {
|
||||||
this.visible = true;
|
|
||||||
this.$emit('focus', event);
|
this.$emit('focus', event);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -531,16 +529,6 @@
|
||||||
handleIconClick(event) {
|
handleIconClick(event) {
|
||||||
if (this.iconClass.indexOf('circle-close') > -1) {
|
if (this.iconClass.indexOf('circle-close') > -1) {
|
||||||
this.deleteSelected(event);
|
this.deleteSelected(event);
|
||||||
} else {
|
|
||||||
this.toggleMenu();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
handleMouseDown(event) {
|
|
||||||
if (event.target.tagName !== 'INPUT') return;
|
|
||||||
if (this.visible) {
|
|
||||||
this.handleClose();
|
|
||||||
event.preventDefault();
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -674,8 +662,12 @@
|
||||||
},
|
},
|
||||||
|
|
||||||
selectOption() {
|
selectOption() {
|
||||||
if (this.options[this.hoverIndex]) {
|
if (!this.visible) {
|
||||||
this.handleOptionSelect(this.options[this.hoverIndex]);
|
this.toggleMenu();
|
||||||
|
} else {
|
||||||
|
if (this.options[this.hoverIndex]) {
|
||||||
|
this.handleOptionSelect(this.options[this.hoverIndex]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -440,7 +440,7 @@ describe('Select', () => {
|
||||||
};
|
};
|
||||||
vm = getSelectVm({ filterable: true, filterMethod });
|
vm = getSelectVm({ filterable: true, filterMethod });
|
||||||
const select = vm.$children[0];
|
const select = vm.$children[0];
|
||||||
select.$el.querySelector('input').focus();
|
select.$el.click();
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
select.selectedLabel = '面';
|
select.selectedLabel = '面';
|
||||||
select.onInputChange();
|
select.onInputChange();
|
||||||
|
@ -479,7 +479,7 @@ describe('Select', () => {
|
||||||
|
|
||||||
const select = vm.$children[0];
|
const select = vm.$children[0];
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
select.$el.querySelector('input').focus();
|
select.$el.click();
|
||||||
select.query = '3';
|
select.query = '3';
|
||||||
select.handleQueryChange('3');
|
select.handleQueryChange('3');
|
||||||
select.selectOption();
|
select.selectOption();
|
||||||
|
|
Loading…
Reference in New Issue