Skip to content

Commit ba952e1

Browse files
committed
minor fixes.
Signed-off-by: Krishna Gupta <belivethatkg@gmail.com>
1 parent 17d4c6b commit ba952e1

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

src/components/TextPicker/TextSelectorModal.tsx

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import {useFocusEffect} from '@react-navigation/native';
22
import React, {useCallback, useRef, useState} from 'react';
33
import {View} from 'react-native';
4-
import type {TextInput as RNTextInput} from 'react-native';
54
import Button from '@components/Button';
65
import HeaderWithBackButton from '@components/HeaderWithBackButton';
76
import Modal from '@components/Modal';
87
import ScreenWrapper from '@components/ScreenWrapper';
98
import ScrollView from '@components/ScrollView';
109
import TextInput from '@components/TextInput';
10+
import type {BaseTextInputRef} from '@components/TextInput/BaseTextInput/types';
1111
import useLocalize from '@hooks/useLocalize';
1212
import useThemeStyles from '@hooks/useThemeStyles';
1313
import CONST from '@src/CONST';
@@ -21,7 +21,7 @@ function TextSelectorModal({value, description = '', onValueSelected, isVisible,
2121
const [currentValue, setValue] = useState(value);
2222
const paddingStyle = usePaddingStyle();
2323

24-
const inputRef = useRef<RNTextInput | null>(null);
24+
const inputRef = useRef<BaseTextInputRef | null>(null);
2525
const focusTimeoutRef = useRef<NodeJS.Timeout | null>(null);
2626

2727
useFocusEffect(
@@ -68,6 +68,12 @@ function TextSelectorModal({value, description = '', onValueSelected, isVisible,
6868
{...rest}
6969
value={currentValue}
7070
onInputChange={setValue}
71+
ref={(ref) => {
72+
if (!ref) {
73+
return;
74+
}
75+
inputRef.current = ref;
76+
}}
7177
/>
7278
</View>
7379
<Button

src/pages/workspace/taxes/WorkspaceCreateTaxPage.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ function WorkspaceCreateTaxPage({
9494
maxLength={CONST.TAX_RATES.NAME_MAX_LENGTH}
9595
multiline={false}
9696
role={CONST.ROLE.PRESENTATION}
97-
autoFocus
9897
/>
9998
<InputWrapper
10099
InputComponent={AmountPicker}

0 commit comments

Comments
 (0)