Skip to content

Commit f96f8aa

Browse files
Merge pull request #75961 from daledah/fix/75184
fix: keypad from payment currency page is shown in preferences page
2 parents 8a56bca + 1e02e78 commit f96f8aa

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

src/pages/settings/Preferences/PaymentCurrencyPage.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import {updateGeneralSettings} from '@libs/actions/Policy/Policy';
1111
import Navigation from '@libs/Navigation/Navigation';
1212
import {getPersonalPolicy} from '@libs/PolicyUtils';
1313
import CONST from '@src/CONST';
14+
import KeyboardUtils from '@src/utils/keyboard';
1415

1516
function PaymentCurrencyPage() {
1617
const styles = useThemeStyles();
@@ -20,6 +21,12 @@ function PaymentCurrencyPage() {
2021

2122
const paymentCurrency = personalPolicy?.outputCurrency ?? CONST.CURRENCY.USD;
2223

24+
const handleDismissKeyboardAndGoBack = () => {
25+
KeyboardUtils.dismiss().then(() => {
26+
Navigation.goBack();
27+
});
28+
};
29+
2330
return (
2431
<ScreenWrapper
2532
includeSafeAreaPaddingBottom={false}
@@ -30,7 +37,7 @@ function PaymentCurrencyPage() {
3037
<HeaderWithBackButton
3138
title={translate('billingCurrency.paymentCurrency')}
3239
shouldShowBackButton
33-
onBackButtonPress={() => Navigation.goBack()}
40+
onBackButtonPress={handleDismissKeyboardAndGoBack}
3441
/>
3542

3643
<Text style={[styles.mh5, styles.mv4]}>{translate('billingCurrency.paymentCurrencyDescription')}</Text>
@@ -42,7 +49,7 @@ function PaymentCurrencyPage() {
4249
if (option.currencyCode !== paymentCurrency) {
4350
updateGeneralSettings(personalPolicyID, personalPolicy?.name ?? '', option.currencyCode);
4451
}
45-
Navigation.goBack();
52+
handleDismissKeyboardAndGoBack();
4653
}}
4754
initiallySelectedCurrencyCode={paymentCurrency}
4855
didScreenTransitionEnd={didScreenTransitionEnd}

0 commit comments

Comments
 (0)