Skip to content

Phone Number Validation Message Issue in Login Page  #4415

@Santhosh-Sellavel

Description

@Santhosh-Sellavel

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Action Performed:

  1. Open new Expensify.
  2. Log out if already logged in
  3. Login using a phone number, enter the phone number without country code

Expected Result:

While entering it should have shown the message
Please enter a phone number including the country code e.g +447814266907

Actual Result:

Only after press continue an error message is shown.

While Entering

Screenshot 2021-08-05 at 6 21 15 AM

After pressing continue

Screenshot 2021-08-05 at 6 26 17 AM

Workaround:

Yes users can add country code after an error shows up

Proposal

We already had a similar issue in search we can use the same check for phoneNumber

In LoginForm.js

onChangeText={text => this.setState({login: text})}
onSubmitEditing={this.validateAndSubmitForm}
autoCapitalize="none"
autoCorrect={false}
keyboardType={getEmailKeyboardType()}
placeholder={this.props.translate('loginForm.phoneOrEmail')}
placeholderTextColor={themeColors.placeholderText}
autoFocus={canFocusInputOnScreenFocus()}
/>
</View>

add these lines below,

{this.state.login
          && !CONST.REGEX.DIGITS_AND_PLUS.test(this.state.login) && Str.isValidPhone(this.state.login)
              && (
              <Text style={[styles.formError]}> 
                  {this.props.translate('messages.noPhoneNumber')}
              </Text>
              )}

Will change styles based on input from the team.
Also, we can move the phone validation logic to Str.js in expensify-common, if needed, and use the same in other places


Platforms

Where the issue is occuring?

  • Web
  • iOS
  • Android
  • Desktop App
  • Mobile Web

Version Number:
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos: Any additional supporting documentation
Expensify/Expensify Issue URL:

View all open jobs on Upwork

Metadata

Metadata

Labels

DailyKSv2EngineeringExternalAdded to denote the issue can be worked on by a contributor

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions