@@ -13,7 +13,8 @@ import {
1313 useLayoutEffect ,
1414} from '@rc-component/util' ;
1515import * as React from 'react' ;
16- import Popup , { type MobileConfig } from './Popup' ;
16+ import Popup from './Popup' ;
17+ import type { MobileConfig } from './Popup' ;
1718import type { TriggerContextProps } from './context' ;
1819import TriggerContext , { UniqueContext } from './context' ;
1920import useAction from './hooks/useAction' ;
@@ -24,15 +25,14 @@ import useWinClick from './hooks/useWinClick';
2425import type { PortalProps } from '@rc-component/portal' ;
2526import { isPointInSafeHoverArea } from './util/safeHover' ;
2627import type { SafeHoverPoint } from './util/safeHover' ;
27-
2828import type {
2929 ActionType ,
3030 AlignType ,
3131 ArrowPos ,
3232 ArrowTypeOuter ,
3333 BuildInPlacements ,
3434} from './interface' ;
35- import { getAlignPopupClassName } from './util' ;
35+ import { clamp , getAlignPopupClassName } from './util' ;
3636
3737export type {
3838 ActionType ,
@@ -480,10 +480,8 @@ export function generateTrigger(
480480 popupEle . getBoundingClientRect ( ) ,
481481 ) ;
482482
483- const refreshDelay = Math . max (
484- 1000 / 60 ,
485- Math . min ( mouseLeaveDelay * 1000 , 1000 ) ,
486- ) ;
483+ // Between 1 frame and 1 second
484+ const refreshDelay = clamp ( mouseLeaveDelay * 1000 , 1000 / 60 , 1000 ) ;
487485
488486 const scheduleRefresh = ( ) => {
489487 const safeHover = safeHoverRef . current ;
0 commit comments