Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

a-menu组件在collapsed折叠的状态下,通过js设置selectedKeys为某个二级菜单时会弹出卡片并选中,但是鼠标不放上面再移走就不会自动消失。 #7383

Closed
1 task
romande opened this issue Feb 27, 2024 · 2 comments
Labels

Comments

@romande
Copy link

romande commented Feb 27, 2024

  • I have searched the issues of this repository and believe that this is not a duplicate.

Version

4.1.2

Environment

Microsoft Edge122.0.2365.52 (正式版本) (64 位)

Reproduction link

https://www.antdv.com/components/menu-cn#components-menu-demo-inline-collapsed

Steps to reproduce

内嵌菜单,状态缩为缩起时:js里通过设置selectedKeys选中某个二级菜单,二级菜单会以气泡卡片形式弹出并选中菜单。但是气泡卡片会一直停留在页面上。只有鼠标移动到卡片上再移开才会消失。

GIF

动画

代码示例

<a-menu
v-model:selectedKeys="selectedKeys"
mode="inline"
theme="dark"
:inline-collapsed="collapsed"
:items="menus"
@select="menuChoose"
:open-keys="state.openKeys"
@openChange="onOpenChange"
></a-menu>
</a-layout-sider>

// 高亮显示选中的菜单项
const openAndChooseSelectedMenu = (key) => {
// 展开被选中的菜单(这边的写法只支持两层菜单)
menus.value.forEach(m => {
if(m.children && m.children.find(cm => cm.key === key)) {
state.openKeys = [m.key]
}
});
// 选择具体某个菜单项
selectedKeys.value = [key]
}

What is expected?

折叠的情况下,二级菜单弹出并高亮后自动消失。

What is actually happening?

二级菜单弹出选中后,一直停留在页面上。

@aShu-guo
Copy link
Contributor

aShu-guo commented Mar 5, 2024

能否提供一个可复现的最小仓库地址呢?

Copy link

github-actions bot commented May 5, 2024

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants