1
1
import { useFocusEffect } from '@react-navigation/native' ;
2
2
import React , { useCallback , useRef , useState } from 'react' ;
3
3
import { View } from 'react-native' ;
4
- import type { TextInput as RNTextInput } from 'react-native' ;
5
4
import Button from '@components/Button' ;
6
5
import HeaderWithBackButton from '@components/HeaderWithBackButton' ;
7
6
import Modal from '@components/Modal' ;
8
7
import ScreenWrapper from '@components/ScreenWrapper' ;
9
8
import ScrollView from '@components/ScrollView' ;
10
9
import TextInput from '@components/TextInput' ;
10
+ import type { BaseTextInputRef } from '@components/TextInput/BaseTextInput/types' ;
11
11
import useLocalize from '@hooks/useLocalize' ;
12
12
import useThemeStyles from '@hooks/useThemeStyles' ;
13
13
import CONST from '@src/CONST' ;
@@ -21,7 +21,7 @@ function TextSelectorModal({value, description = '', onValueSelected, isVisible,
21
21
const [ currentValue , setValue ] = useState ( value ) ;
22
22
const paddingStyle = usePaddingStyle ( ) ;
23
23
24
- const inputRef = useRef < RNTextInput | null > ( null ) ;
24
+ const inputRef = useRef < BaseTextInputRef | null > ( null ) ;
25
25
const focusTimeoutRef = useRef < NodeJS . Timeout | null > ( null ) ;
26
26
27
27
useFocusEffect (
@@ -68,6 +68,12 @@ function TextSelectorModal({value, description = '', onValueSelected, isVisible,
68
68
{ ...rest }
69
69
value = { currentValue }
70
70
onInputChange = { setValue }
71
+ ref = { ( ref ) => {
72
+ if ( ! ref ) {
73
+ return ;
74
+ }
75
+ inputRef . current = ref ;
76
+ } }
71
77
/>
72
78
</ View >
73
79
< Button
0 commit comments