Skip to content

Commit

Permalink
fix: submenu animation lose #4325
Browse files Browse the repository at this point in the history
  • Loading branch information
tangjinzhou committed Jul 6, 2021
1 parent b7b433e commit 16ee0dd
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 8 deletions.
4 changes: 4 additions & 0 deletions components/menu/src/SubMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,10 @@ export default defineComponent({
{titleNode}
</PopupTrigger>
);
} else {
// 包裹一层,保持结构一致,防止动画丢失
// https://github.com/vueComponent/ant-design-vue/issues/4325
titleNode = <PopupTrigger>{titleNode}</PopupTrigger>;
}
return (
<MenuContextProvider props={{ mode: renderMode }}>
Expand Down
9 changes: 1 addition & 8 deletions components/menu/style/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -120,14 +120,6 @@
background-color: @border-color-split;
}

&-item:hover,
&-item-active,
&:not(&-inline) &-submenu-open,
&-submenu-active,
&-submenu-title:hover {
color: @menu-highlight-color;
}

&-horizontal &-item,
&-horizontal &-submenu {
margin-top: -1px;
Expand Down Expand Up @@ -671,5 +663,6 @@
}
}

@import './light';
@import './dark';
@import './rtl';
12 changes: 12 additions & 0 deletions components/menu/style/light.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.@{menu-prefix-cls} {
// light theme
&-light {
.@{menu-prefix-cls}-item:hover,
.@{menu-prefix-cls}-item-active,
.@{menu-prefix-cls}:not(.@{menu-prefix-cls}-inline) .@{menu-prefix-cls}-submenu-open,
.@{menu-prefix-cls}-submenu-active,
.@{menu-prefix-cls}-submenu-title:hover {
color: @menu-highlight-color;
}
}
}

0 comments on commit 16ee0dd

Please sign in to comment.