@@ -11,6 +11,7 @@ import {updateGeneralSettings} from '@libs/actions/Policy/Policy';
1111import Navigation from '@libs/Navigation/Navigation' ;
1212import { getPersonalPolicy } from '@libs/PolicyUtils' ;
1313import CONST from '@src/CONST' ;
14+ import KeyboardUtils from '@src/utils/keyboard' ;
1415
1516function 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