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 switching to manual address when adding bank account #6332

Merged
merged 2 commits into from
Nov 16, 2021
Merged
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
10 changes: 5 additions & 5 deletions src/pages/ReimbursementAccount/IdentityForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,12 @@ const IdentityForm = (props) => {
errorText={props.errors.ssnLast4 ? props.translate('bankAccount.error.ssnLast4') : ''}
maxLength={CONST.BANK_ACCOUNT.MAX_LENGTH.SSN}
/>
{props.manualAddress ? (
{props.values.manualAddress ? (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do the other props need to be updated as well? For example, value={props.city} is still used even though city is inside values in the propTypes definition.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uh yeah good thinking, probably. I was too focused on fixing the issue and didn't think to check the rest, I'll check now.

<>
<ExpensiTextInput
label={props.translate('common.personalAddress')}
containerStyles={[styles.mt4]}
value={props.street}
value={props.values.street}
onChangeText={value => props.onFieldChange('addressStreet', value)}
errorText={props.errors.street ? props.translate('bankAccount.error.address') : ''}
/>
Expand All @@ -147,15 +147,15 @@ const IdentityForm = (props) => {
<View style={[styles.flex2, styles.mr2]}>
<ExpensiTextInput
label={props.translate('common.city')}
value={props.city}
value={props.values.city}
onChangeText={value => props.onFieldChange('addressCity', value)}
errorText={props.errors.city ? props.translate('bankAccount.error.addressCity') : ''}
translateX={-14}
/>
</View>
<View style={[styles.flex1]}>
<StatePicker
value={props.state}
value={props.values.state}
onChange={value => props.onFieldChange('addressState', value)}
errorText={props.errors.state ? props.translate('bankAccount.error.addressState') : ''}
hasError={Boolean(props.errors.state)}
Expand All @@ -166,7 +166,7 @@ const IdentityForm = (props) => {
label={props.translate('common.zip')}
containerStyles={[styles.mt4]}
keyboardType={CONST.KEYBOARD_TYPE.NUMERIC}
value={props.zipCode}
value={props.values.zipCode}
onChangeText={value => props.onFieldChange('addressZipCode', value)}
errorText={props.errors.zipCode ? props.translate('bankAccount.error.zipCode') : ''}
maxLength={CONST.BANK_ACCOUNT.MAX_LENGTH.ZIP_CODE}
Expand Down