Skip to content

Commit 16ee0dd

Browse files
committed
fix: submenu animation lose #4325
1 parent b7b433e commit 16ee0dd

File tree

3 files changed

+17
-8
lines changed

3 files changed

+17
-8
lines changed

components/menu/src/SubMenu.tsx

+4
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,10 @@ export default defineComponent({
283283
{titleNode}
284284
</PopupTrigger>
285285
);
286+
} else {
287+
// 包裹一层,保持结构一致,防止动画丢失
288+
// https://github.com/vueComponent/ant-design-vue/issues/4325
289+
titleNode = <PopupTrigger>{titleNode}</PopupTrigger>;
286290
}
287291
return (
288292
<MenuContextProvider props={{ mode: renderMode }}>

components/menu/style/index.less

+1-8
Original file line numberDiff line numberDiff line change
@@ -120,14 +120,6 @@
120120
background-color: @border-color-split;
121121
}
122122

123-
&-item:hover,
124-
&-item-active,
125-
&:not(&-inline) &-submenu-open,
126-
&-submenu-active,
127-
&-submenu-title:hover {
128-
color: @menu-highlight-color;
129-
}
130-
131123
&-horizontal &-item,
132124
&-horizontal &-submenu {
133125
margin-top: -1px;
@@ -671,5 +663,6 @@
671663
}
672664
}
673665

666+
@import './light';
674667
@import './dark';
675668
@import './rtl';

components/menu/style/light.less

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
.@{menu-prefix-cls} {
2+
// light theme
3+
&-light {
4+
.@{menu-prefix-cls}-item:hover,
5+
.@{menu-prefix-cls}-item-active,
6+
.@{menu-prefix-cls}:not(.@{menu-prefix-cls}-inline) .@{menu-prefix-cls}-submenu-open,
7+
.@{menu-prefix-cls}-submenu-active,
8+
.@{menu-prefix-cls}-submenu-title:hover {
9+
color: @menu-highlight-color;
10+
}
11+
}
12+
}

0 commit comments

Comments
 (0)