Skip to content

Commit

Permalink
Merge pull request #4862 from Expensify/joe-fix-android-autocomplete
Browse files Browse the repository at this point in the history
Fix autocomplete issue in VBA flow
  • Loading branch information
Jag96 authored Aug 26, 2021
2 parents 7f921ef + db0e12a commit c1bc5bc
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/components/ExpensiTextInput/index.android.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ const ExpensiTextInput = forwardRef((props, ref) => (
<BaseExpensiTextInput
// eslint-disable-next-line react/jsx-props-no-spreading
{...props}

// Setting autoCompleteType to new-password throws an error on Android, so fall back to password in that case
// eslint-disable-next-line react/jsx-props-no-multi-spaces
autoCompleteType={props.autoCompleteType === 'new-password' ? 'password' : props.autoCompleteType}
innerRef={ref}
inputStyle={[
styles.expensiTextInput,
Expand Down
4 changes: 4 additions & 0 deletions src/components/ExpensiTextInput/index.ios.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ const ExpensiTextInput = forwardRef((props, ref) => (
<BaseExpensiTextInput
// eslint-disable-next-line react/jsx-props-no-spreading
{...props}

// Setting autoCompleteType to new-password throws an error on iOS, so fall back to password in that case
// eslint-disable-next-line react/jsx-props-no-multi-spaces
autoCompleteType={props.autoCompleteType === 'new-password' ? 'password' : props.autoCompleteType}
innerRef={ref}
inputStyle={[styles.expensiTextInput]}
/>
Expand Down
5 changes: 4 additions & 1 deletion src/pages/ReimbursementAccount/CompanyStep.js
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,6 @@ class CompanyStep extends React.Component {
: ''}
/>
<ExpensiTextInput
autoCompleteType="password"
label={`Expensify ${this.props.translate('common.password')}`}
containerStyles={[styles.mt4]}
secureTextEntry
Expand All @@ -319,6 +318,10 @@ class CompanyStep extends React.Component {
errorText={error === this.props.translate('common.passwordCannotBeBlank')
? this.props.translate('common.passwordCannotBeBlank')
: ''}

// Use new-password to prevent an autoComplete bug https://github.com/Expensify/Expensify/issues/173177
// eslint-disable-next-line react/jsx-props-no-multi-spaces
autoCompleteType="new-password"
/>
<CheckboxWithLabel
isChecked={this.state.hasNoConnectionToCannabis}
Expand Down

0 comments on commit c1bc5bc

Please sign in to comment.