Skip to content
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
9 changes: 2 additions & 7 deletions src/components/AddPaymentCard/PaymentCardForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -165,10 +165,6 @@ function PaymentCardForm({
errors.addressStreet = translate(label.error.addressStreet);
}

if (values.addressZipCode && !ValidationUtils.isValidZipCode(values.addressZipCode)) {

@getusha getusha Dec 3, 2024

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

should we add a comment to prevent others reverting this change?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think the change will be visible in blame which will lead to this PR / issue and it's self explanatory that we removed the specific Zip Code validation for time being, the explanation being visible in the PRs description.

errors.addressZipCode = translate(label.error.addressZipCode);
}

if (!values.acceptTerms) {
errors.acceptTerms = translate('common.error.acceptTerms');
}
Expand Down Expand Up @@ -283,10 +279,9 @@ function PaymentCardForm({
InputComponent={TextInput}
defaultValue={data?.addressZipCode}
inputID={INPUT_IDS.ADDRESS_ZIP_CODE}
label={translate('common.zip')}
aria-label={translate('common.zip')}
label={translate('common.zipPostCode')}
aria-label={translate('common.zipPostCode')}
role={CONST.ROLE.PRESENTATION}
inputMode={CONST.INPUT_MODE.NUMERIC}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I removed this line because on mWeb platforms this would only allow numeric input which would restrict users from typing UK Zip Codes what contain characters and numbers (ex. SW8 4LT). The issue was present on iOS: mWeb as well, here's an example from Android: mWeb before and after removing the line:

Before After
android-mweb-before android-mweb-after

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

that makes sense, thanks

maxLength={CONST.BANK_ACCOUNT.MAX_LENGTH.ZIP_CODE}
containerStyles={[styles.mt5]}
/>
Expand Down