Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix autocomplete issue in VBA flow #4862

Merged
merged 4 commits into from
Aug 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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