Commit 8a32c341 authored by huangjinqiang's avatar huangjinqiang Committed by Jikkai Xiao

Cascader: prevent value changing when menu is closing (#12507)

parent 03ae4a44
......@@ -230,12 +230,14 @@
hover: 'mouseenter'
}[expandTrigger];
const triggerHandler = () => {
this.activeItem(item, menuIndex);
this.$nextTick(() => {
// adjust self and next level
this.scrollMenu(this.$refs.menus[menuIndex]);
this.scrollMenu(this.$refs.menus[menuIndex + 1]);
});
if (this.visible) {
this.activeItem(item, menuIndex);
this.$nextTick(() => {
// adjust self and next level
this.scrollMenu(this.$refs.menus[menuIndex]);
this.scrollMenu(this.$refs.menus[menuIndex + 1]);
});
}
};
events.on[triggerEvent] = triggerHandler;
if (triggerEvent === 'mouseenter' && this.changeOnSelect) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment