Skip to content

Commit

Permalink
Merge pull request #8897 from phivh/fix/android-navigation-back
Browse files Browse the repository at this point in the history
Fix android navigation back
  • Loading branch information
MonilBhavsar authored May 10, 2022
2 parents 8d46ec7 + 8ebb9a0 commit 3cdd9a2
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/components/HeaderWithCloseButton.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';
import {
View, TouchableOpacity,
View, TouchableOpacity, Keyboard,
} from 'react-native';
import styles from '../styles/styles';
import Header from './Header';
Expand All @@ -12,6 +12,7 @@ import * as Expensicons from './Icon/Expensicons';
import withLocalize, {withLocalizePropTypes} from './withLocalize';
import Tooltip from './Tooltip';
import ThreeDotsMenu, {ThreeDotsMenuItemPropTypes} from './ThreeDotsMenu';
import VirtualKeyboard from '../libs/VirtualKeyboard';

const propTypes = {
/** Title of the Header */
Expand Down Expand Up @@ -113,7 +114,12 @@ const HeaderWithCloseButton = props => (
{props.shouldShowBackButton && (
<Tooltip text={props.translate('common.back')}>
<TouchableOpacity
onPress={props.onBackButtonPress}
onPress={() => {
if (VirtualKeyboard.isOpen()) {
Keyboard.dismiss();
}
props.onBackButtonPress();
}}
style={[styles.touchableButtonImage]}
>
<Icon src={Expensicons.BackArrow} />
Expand Down

0 comments on commit 3cdd9a2

Please sign in to comment.