File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -576,6 +576,8 @@ export function generateTrigger(
576
576
577
577
if ( hoverToShow ) {
578
578
const onMouseEnterCallback = ( event : React . MouseEvent ) => {
579
+ // Clear any delayed close operations
580
+ clearDelay ( ) ;
579
581
setMousePosByEvent ( event ) ;
580
582
} ;
581
583
@@ -596,6 +598,9 @@ export function generateTrigger(
596
598
) ;
597
599
598
600
onPopupMouseEnter = ( event ) => {
601
+ // Always clear the delay to ensure the mouse returns to the menu to cancel the close
602
+ clearDelay ( ) ;
603
+
599
604
// Only trigger re-open when popup is visible or in motion
600
605
// and ensure the mouse is entering the popup area
601
606
if (
@@ -630,11 +635,8 @@ export function generateTrigger(
630
635
ignoreMouseTrigger ,
631
636
) ;
632
637
633
- onPopupMouseLeave = ( event : React . MouseEvent ) => {
634
- // fix issue: https://github.com/ant-design/ant-design/issues/54496
635
- if ( popupEle ?. contains ( event . target as HTMLElement ) ) {
636
- triggerOpen ( false , mouseLeaveDelay ) ;
637
- }
638
+ onPopupMouseLeave = ( ) => {
639
+ triggerOpen ( false , mouseLeaveDelay ) ;
638
640
} ;
639
641
}
640
642
You can’t perform that action at this time.
0 commit comments