Skip to content

Commit b5b31f2

Browse files
cs1707hzsrc
authored andcommitted
Cascader: optimize performance (ElemeFE#21231)
1 parent ce038b2 commit b5b31f2

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/cascader/src/cascader.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,7 @@ export default {
413413
handleDropdownLeave() {
414414
this.filtering = false;
415415
this.inputValue = this.presentText;
416+
this.doDestroy();
416417
},
417418
handleKeyDown(event) {
418419
switch (event.keyCode) {
@@ -643,7 +644,9 @@ export default {
643644
const offsetHeight = Math.round(tags.getBoundingClientRect().height);
644645
const height = Math.max(offsetHeight + 6, inputInitialHeight) + 'px';
645646
inputInner.style.height = height;
646-
this.updatePopper();
647+
if (this.dropDownVisible) {
648+
this.updatePopper();
649+
}
647650
}
648651
},
649652

0 commit comments

Comments
 (0)