mirror of https://github.com/ElemeFE/element
Cascader: prevent value changing when menu is closing (#12507)
parent
03ae4a446a
commit
8a32c3414f
|
@ -230,12 +230,14 @@
|
||||||
hover: 'mouseenter'
|
hover: 'mouseenter'
|
||||||
}[expandTrigger];
|
}[expandTrigger];
|
||||||
const triggerHandler = () => {
|
const triggerHandler = () => {
|
||||||
this.activeItem(item, menuIndex);
|
if (this.visible) {
|
||||||
this.$nextTick(() => {
|
this.activeItem(item, menuIndex);
|
||||||
// adjust self and next level
|
this.$nextTick(() => {
|
||||||
this.scrollMenu(this.$refs.menus[menuIndex]);
|
// adjust self and next level
|
||||||
this.scrollMenu(this.$refs.menus[menuIndex + 1]);
|
this.scrollMenu(this.$refs.menus[menuIndex]);
|
||||||
});
|
this.scrollMenu(this.$refs.menus[menuIndex + 1]);
|
||||||
|
});
|
||||||
|
}
|
||||||
};
|
};
|
||||||
events.on[triggerEvent] = triggerHandler;
|
events.on[triggerEvent] = triggerHandler;
|
||||||
if (triggerEvent === 'mouseenter' && this.changeOnSelect) {
|
if (triggerEvent === 'mouseenter' && this.changeOnSelect) {
|
||||||
|
|
Loading…
Reference in New Issue