Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -576,6 +576,8 @@ export function generateTrigger(

if (hoverToShow) {
const onMouseEnterCallback = (event: React.MouseEvent) => {
// Clear any delayed close operations
clearDelay();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clearDelay 是对自身的触发进行清理,这个在鼠标事件 trigger open 的时候已经调用了,并不会影响多层的逻辑。应该是通过 parentContext 来告知 parent 需要复活才对。

setMousePosByEvent(event);
};

Expand All @@ -596,7 +598,11 @@ export function generateTrigger(
);

onPopupMouseEnter = (event) => {
// Only trigger re-open when popup is visible
// Always clear the delay to ensure the mouse returns to the menu to cancel the close
clearDelay();

// Only trigger re-open when popup is visible or in motion
// and ensure the mouse is entering the popup area
if (
(mergedOpen || inMotion) &&
popupEle?.contains(event.target as HTMLElement)
Expand Down
Loading