diff --git a/Stripe/STPPaymentCardTextField.m b/Stripe/STPPaymentCardTextField.m index 5f98af565e8..0a4e719bbd6 100644 --- a/Stripe/STPPaymentCardTextField.m +++ b/Stripe/STPPaymentCardTextField.m @@ -195,6 +195,11 @@ - (void)commonInit { } [self addSubview:brandImageView]; + // On small screens, the number field fits ~4 numbers, and the brandImage is just as large. + // Previously, taps on the brand image would *dismiss* the keyboard. Make it move to the numberField instead + brandImageView.userInteractionEnabled = YES; + [brandImageView addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:numberField + action:@selector(becomeFirstResponder)]]; self.focusedTextFieldForLayout = @(STPCardFieldTypeNumber); [self updateCVCPlaceholder]; @@ -1070,6 +1075,7 @@ must be visible so they can be tapped over to (although fieldsHeight)]; maskView.backgroundColor = [UIColor blackColor]; maskView.opaque = YES; + maskView.userInteractionEnabled = NO; [UIView performWithoutAnimation:^{ self.numberField.maskView = maskView; }];