ant-design/ant-design

Menu horizontal Submenu closes when cursor crossing from item to popup

Open

#40,337 建立於 2023年1月19日

在 GitHub 查看
 (2 留言) (0 反應) (0 負責人)TypeScript (98,031 star) (54,612 fork)batch import
Inactivehelp wantedunconfirmed

描述

Reproduction link

Edit on CodeSandbox

Steps to reproduce

Open Menu dropdown and place cursor about on bottom border of the item and above the popup, or move cursor across from item to popup slowly

What is expected?

Submenu to stay open while crossing from Item to Submenu

What is actually happening?

Sometimes Submenu closes unexpectedly, depends on how fast and precise user moves mouse cursor

Environment Info
antd 5.1.5
React 18
System windows
Browser Firefox, Chrome

Two places to fix:
Adding "pointer-events: none" to Item's css :after rule (to its bottom line)
And syncing Popup's Align offset with popup's css :before rule. For now, Popup Align has offset 8px, but in css the offset is -7px, which should be the same -8px.

貢獻者指南