@@ -34,6 +34,8 @@ export interface PopupProps<DateType extends object = any, PresetValue = DateTyp
3434  activeInfo ?: [ activeInputLeft : number ,  activeInputRight : number ,  selectorWidth : number ] ; 
3535  // Direction 
3636  direction ?: 'ltr'  |  'rtl' ; 
37+   // focus index 
38+   index : number ; 
3739
3840  // Fill 
3941  /** TimePicker or showTime only */ 
@@ -58,7 +60,7 @@ export default function Popup<DateType extends object = any>(props: PopupProps<D
5860    range, 
5961    multiple, 
6062    activeInfo =  [ 0 ,  0 ,  0 ] , 
61- 
63+     index  =   0 , 
6264    // Presets 
6365    presets, 
6466    onPresetHover, 
@@ -80,7 +82,6 @@ export default function Popup<DateType extends object = any>(props: PopupProps<D
8082    onOk, 
8183    onSubmit, 
8284  }  =  props ; 
83- 
8485  const  {  prefixCls }  =  React . useContext ( PickerContext ) ; 
8586  const  panelPrefixCls  =  `${ prefixCls }  -panel` ; 
8687
@@ -118,7 +119,8 @@ export default function Popup<DateType extends object = any>(props: PopupProps<D
118119      // Arrow Offset 
119120      const  wrapperRect  =  wrapperRef . current . getBoundingClientRect ( ) ; 
120121      if  ( ! wrapperRect . height  ||  wrapperRect . right  <  0 )  { 
121-         setRetryTimes ( ( times )  =>  Math . max ( 0 ,  times  -  1 ) ) ; 
122+         // Index is designed to be compatible with the bug of inconsistency between React 18 useEffect and React 19 
123+         setRetryTimes ( ( times )  =>  Math . max ( 0 ,  times  -  index  -  1 ) ) ; 
122124        return ; 
123125      } 
124126
@@ -138,7 +140,16 @@ export default function Popup<DateType extends object = any>(props: PopupProps<D
138140        setContainerOffset ( 0 ) ; 
139141      } 
140142    } 
141-   } ,  [ retryTimes ,  rtl ,  containerWidth ,  activeInputLeft ,  activeInputRight ,  selectorWidth ,  range ] ) ; 
143+   } ,  [ 
144+     retryTimes , 
145+     rtl , 
146+     containerWidth , 
147+     activeInputLeft , 
148+     activeInputRight , 
149+     selectorWidth , 
150+     range , 
151+     index , 
152+   ] ) ; 
142153
143154  // ======================== Custom ======================== 
144155  function  filterEmpty < T > ( list : T [ ] )  { 
0 commit comments