Cascader: optimize performance (#21231)

This commit is contained in:
好多大米 2021-08-17 16:10:05 +08:00 committed by GitHub
parent 6fda9a0821
commit 72be8f536f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -413,6 +413,7 @@ export default {
handleDropdownLeave() {
this.filtering = false;
this.inputValue = this.presentText;
this.doDestroy();
},
handleKeyDown(event) {
switch (event.keyCode) {
@ -643,7 +644,9 @@ export default {
const offsetHeight = Math.round(tags.getBoundingClientRect().height);
const height = Math.max(offsetHeight + 6, inputInitialHeight) + 'px';
inputInner.style.height = height;
this.updatePopper();
if (this.dropDownVisible) {
this.updatePopper();
}
}
},