@@ -128,7 +128,7 @@ export const AutocompleteDropdown = memo<
128128 setDirection ( ( screenHeight - kbHeight ) / 2 > positionY ? 'down' : 'up' )
129129 resolve ( )
130130 } ,
131- waitForKeyboard ? Platform . select ( { ios : 600 , android : 150 , default : 1 } ) : 1 , // wait for keyboard to show
131+ waitForKeyboard ? Platform . select ( { ios : 600 , android : 250 , default : 1 } ) : 1 , // wait for keyboard to show
132132 )
133133 } )
134134 } ,
@@ -156,20 +156,17 @@ export const AutocompleteDropdown = memo<
156156 inputRef . current ?. blur ( )
157157 } , [ ] )
158158
159- const open = useCallback (
160- async ( { focused } = { focused : false } ) => {
161- if ( directionProp ) {
162- setDirection ( directionProp )
163- } else {
164- await calculateDirection ( { waitForKeyboard : focused } )
165- }
159+ const open = useCallback ( async ( ) => {
160+ if ( directionProp ) {
161+ setDirection ( directionProp )
162+ } else {
163+ await calculateDirection ( { waitForKeyboard : ! ! inputRef . current ?. isFocused ( ) } )
164+ }
166165
167- setTimeout ( ( ) => {
168- setIsOpened ( true )
169- } , 0 )
170- } ,
171- [ calculateDirection , directionProp , setDirection ] ,
172- )
166+ setTimeout ( ( ) => {
167+ setIsOpened ( true )
168+ } , 0 )
169+ } , [ calculateDirection , directionProp , setDirection ] )
173170
174171 const toggle = useCallback ( ( ) => {
175172 isOpened ? close ( ) : open ( )
@@ -396,7 +393,7 @@ export const AutocompleteDropdown = memo<
396393 if ( typeof onFocusProp === 'function' ) {
397394 onFocusProp ( e )
398395 }
399- open ( { focused : true } )
396+ open ( )
400397 } ,
401398 [ clearOnFocus , onFocusProp , open ] ,
402399 )
0 commit comments