From b2dda336d5694a8b7feb85dcba44313a47ec1a2c Mon Sep 17 00:00:00 2001 From: VH Date: Sat, 3 Jun 2023 16:37:23 +0700 Subject: [PATCH] Show default keyboard if login is not an email in CloseAccount page --- src/CONST.js | 1 + src/pages/settings/Security/CloseAccountPage.js | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/CONST.js b/src/CONST.js index 4557c66a42cc..5e640df4a1a5 100755 --- a/src/CONST.js +++ b/src/CONST.js @@ -796,6 +796,7 @@ const CONST = { EMAIL_ADDRESS: 'email-address', ASCII_CAPABLE: 'ascii-capable', URL: 'url', + DEFAULT: 'default', }, ATTACHMENT_MESSAGE_TEXT: '[Attachment]', diff --git a/src/pages/settings/Security/CloseAccountPage.js b/src/pages/settings/Security/CloseAccountPage.js index 6d0988401137..6af8d719cf5b 100644 --- a/src/pages/settings/Security/CloseAccountPage.js +++ b/src/pages/settings/Security/CloseAccountPage.js @@ -3,6 +3,7 @@ import {View} from 'react-native'; import {withOnyx} from 'react-native-onyx'; import PropTypes from 'prop-types'; import _ from 'underscore'; +import Str from 'expensify-common/lib/str'; import HeaderWithCloseButton from '../../../components/HeaderWithCloseButton'; import Navigation from '../../../libs/Navigation/Navigation'; import ROUTES from '../../../ROUTES'; @@ -119,7 +120,7 @@ class CloseAccountPage extends Component { label={this.props.translate('closeAccountPage.enterDefaultContact')} containerStyles={[styles.mt5]} autoCorrect={false} - keyboardType={CONST.KEYBOARD_TYPE.EMAIL_ADDRESS} + keyboardType={Str.isValidEmail(userEmailOrPhone) ? CONST.KEYBOARD_TYPE.EMAIL_ADDRESS : CONST.KEYBOARD_TYPE.DEFAULT} />