tusen-ai / naive-ui

A Vue 3 Component Library. Fairly Complete. Theme Customizable. Uses TypeScript. Fast.
https://www.naiveui.com
MIT License
16.11k stars 1.67k forks source link

下拉菜单dropdown,有多个带子菜单的一级菜单时,只有最后一个正常工作 #6306

Open abcde1477 opened 1 month ago

abcde1477 commented 1 month ago

Describe the bug

bug in dropdown(before)

bug in dropdown(after)
如图所示,当鼠标移动到二级菜单时,应该展示的二级菜单消失,展开了最后一个带子菜单的一级菜单。
测试了发现与一级菜单是否相邻无关。

Steps to reproduce

  1. use \<n-dropdown>\<n-button>\</n-button>\</n-dropdown>
  2. in options, set more 2 menu items with children.

Link to minimal reproduction

github : https://github.com/abcde1477/bug-report/tree/main/naive-ui-2-39 codesandbox: https://codesandbox.io/p/github/abcde1477/bug-report/codesandbox-naive

System Info

System:
    OS: Linux 5.15 Ubuntu 22.04.3 LTS 22.04.3 LTS (Jammy Jellyfish)
    CPU: (8) x64 Intel(R) Core(TM) i7-3770 CPU @ 3.40GHz
    Memory: 11.15 GB / 15.50 GB
    Container: Yes
    Shell: 5.1.16 - /bin/bash
  Binaries:
    Node: 20.11.1 - ~/.nvm/versions/node/v20.11.1/bin/node
    npm: 10.2.4 - ~/.nvm/versions/node/v20.11.1/bin/npm
  Browsers:
    Firefox
-----------------------
  System:
    OS: macOS 14.5
    CPU: (8) arm64 Apple M2
    Memory: 99.53 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.11.1 - /usr/local/bin/node
    Yarn: 1.22.22 - /opt/homebrew/bin/yarn
    npm: 10.2.4 - /usr/local/bin/npm
    pnpm: 9.1.0 - /opt/homebrew/bin/pnpm
  Browsers:
    Firefox

Used Package Manager

npm

Validations

video

https://github.com/user-attachments/assets/e8fce211-7f5e-4bb6-96bd-32e017fee3e4

jahnli commented 2 weeks ago

Provide a based on CodeSandbox or stackblitz [Minimal, Reproducible Example] (https://stackoverflow.com/help/minimal-reproducible-example)

abcde1477 commented 1 week ago

Thank you for your response.I have created a minimal reproducible example based on CodeSandbox as requested. It took me some time. You can find it here: https://codesandbox.io/p/github/abcde1477/bug-report/codesandbox-naive Additionally, I recorded a short video demonstrating the bug in action, You can view the video here: https://github.com/abcde1477/bug-report/blob/main/naive-ui-2-39/issue_recording/recording.mov