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

Make sure CVC, Date, and card number are always LTR regardless of the language #3524

Merged
merged 2 commits into from
Mar 26, 2021

Conversation

michelleb-stripe
Copy link
Contributor

Summary

When entering credit card numbers, month, date, and cvc in countries that use rtl formatting, the text view should still be ltr.

Motivation

#3515

Testing

  • Added tests
  • Modified tests
  • Manually verified

@@ -262,6 +262,8 @@ class ExpiryDateEditText @JvmOverloads constructor(
shouldShowError = true
}
}

layoutDirection = LAYOUT_DIRECTION_LTR
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tried several different approaches to try to set this up in robolectric without any luck.

@@ -177,6 +177,8 @@ class CardNumberEditText internal constructor(
}

updateLengthFilter()

this.layoutDirection = LAYOUT_DIRECTION_LTR
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should this be done in StripeEditText?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That feels like a wide sweep, like if you used it for email address, that wouldn't work.

Copy link
Collaborator

Choose a reason for hiding this comment

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

That makes sense. Should we do this for PostalCodeEditText?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Also can we add a comment in the card widgets that they are LTR only if we don't already have that?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I did a little research, and from what I found the postal code edit text is functionality as other apps. I did make a note in the comment as well that this was explicit.

@michelleb-stripe michelleb-stripe merged commit 0552574 into master Mar 26, 2021
@michelleb-stripe michelleb-stripe deleted the michelleb/rtl-layout branch March 26, 2021 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants