Skip to content

Commit

Permalink
STPPaymentCardTextField should work with non-numeric placeholders (#1394
Browse files Browse the repository at this point in the history
)

* STPPaymentCardTextField should work with non-numeric placeholders

* fix color on iOS 13
  • Loading branch information
davidme-stripe authored Sep 27, 2019
1 parent b616e83 commit 587e49c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Stripe/STPPaymentCardTextField.m
Original file line number Diff line number Diff line change
Expand Up @@ -1064,9 +1064,9 @@ must be visible so they can be tapped over to (although

BOOL hasEnteredCardNumber = self.cardNumber.length > 0;
NSString *compressedCardNumber = self.viewModel.compressedCardNumber;
NSString *cardNumberToHide = [(hasEnteredCardNumber ? self.cardNumber : self.viewModel.defaultPlaceholder) stp_stringByRemovingSuffix:compressedCardNumber];
NSString *cardNumberToHide = [(hasEnteredCardNumber ? self.cardNumber : self.numberPlaceholder) stp_stringByRemovingSuffix:compressedCardNumber];

if (cardNumberToHide.length > 0) {
if (cardNumberToHide.length > 0 && [STPCardValidator stringIsNumeric:cardNumberToHide]) {
width = hasEnteredCardNumber ? [self widthForCardNumber:self.cardNumber] : [self numberFieldFullWidth];

CGFloat hiddenWidth = [self widthForCardNumber:cardNumberToHide];
Expand All @@ -1078,7 +1078,7 @@ must be visible so they can be tapped over to (although
maskView.backgroundColor = [UIColor blackColor];
#ifdef __IPHONE_13_0
if (@available(iOS 13.0, *)) {
maskView.backgroundColor = [UIColor systemBackgroundColor];
maskView.backgroundColor = [UIColor labelColor];
}
#endif
maskView.opaque = YES;
Expand Down

0 comments on commit 587e49c

Please sign in to comment.