From 45e3e5c8a466da34a39f9da181624a6953d47e1e Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Fri, 22 Mar 2024 15:54:28 -0600 Subject: [PATCH 1/2] auto focus input --- src/pages/workspace/taxes/ValuePage.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/pages/workspace/taxes/ValuePage.tsx b/src/pages/workspace/taxes/ValuePage.tsx index d008b11ecb15..931aa82002a1 100644 --- a/src/pages/workspace/taxes/ValuePage.tsx +++ b/src/pages/workspace/taxes/ValuePage.tsx @@ -9,6 +9,7 @@ import ScreenWrapper from '@components/ScreenWrapper'; import Text from '@components/Text'; import useLocalize from '@hooks/useLocalize'; import useThemeStyles from '@hooks/useThemeStyles'; +import useAutoFocusInput from '@hooks/useAutoFocusInput'; import {updatePolicyTaxValue, validateTaxValue} from '@libs/actions/TaxRate'; import Navigation from '@libs/Navigation/Navigation'; import type {SettingsNavigatorParamList} from '@libs/Navigation/types'; @@ -35,6 +36,7 @@ function ValuePage({ }: ValuePageProps) { const styles = useThemeStyles(); const {translate} = useLocalize(); + const {inputCallbackRef} = useAutoFocusInput(); const currentTaxRate = PolicyUtils.getTaxByID(policy, taxID); const [value, setValue] = useState(currentTaxRate?.value?.replace('%', '')); @@ -89,6 +91,7 @@ function ValuePage({ onInputChange={setValue} hideCurrencySymbol extraSymbol={%} + ref={inputCallbackRef} /> From 46f3a301cc666daece32dbee094a83b5636eeb5f Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Fri, 22 Mar 2024 16:02:42 -0600 Subject: [PATCH 2/2] fix lint --- src/pages/workspace/taxes/ValuePage.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/workspace/taxes/ValuePage.tsx b/src/pages/workspace/taxes/ValuePage.tsx index 931aa82002a1..6487b3a752b8 100644 --- a/src/pages/workspace/taxes/ValuePage.tsx +++ b/src/pages/workspace/taxes/ValuePage.tsx @@ -7,9 +7,9 @@ import type {FormOnyxValues} from '@components/Form/types'; import HeaderWithBackButton from '@components/HeaderWithBackButton'; import ScreenWrapper from '@components/ScreenWrapper'; import Text from '@components/Text'; +import useAutoFocusInput from '@hooks/useAutoFocusInput'; import useLocalize from '@hooks/useLocalize'; import useThemeStyles from '@hooks/useThemeStyles'; -import useAutoFocusInput from '@hooks/useAutoFocusInput'; import {updatePolicyTaxValue, validateTaxValue} from '@libs/actions/TaxRate'; import Navigation from '@libs/Navigation/Navigation'; import type {SettingsNavigatorParamList} from '@libs/Navigation/types';