Sets accessibilityLabel on postalCodeField in STPPaymentCardTextField (#296)

* Sets accessibilityLabel on postalCodeField in STPPaymentCardTextField

* Community credit in CHANGELOG
This commit is contained in:
Cameron 2021-08-03 16:21:46 -07:00 committed by GitHub
parent b26fe514a6
commit 7c74bcbdfb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

@ -1,5 +1,6 @@
## ?????
* Fixes broken card scanning links. (Thanks [ricsantos](https://github.com/ricsantos))
* Fixes accessibilityLabel for postal code field. (Thanks [romanilchyshyndepop](https://github.com/romanilchyshyndepop))
* Improves compile time by 30% [#1846](https://github.com/stripe/stripe-ios/pull/1846) (Thanks [JonathanDowning](https://github.com/JonathanDowning)!)
## 21.7.0 2021-07-07

View File

@ -786,9 +786,12 @@ open class STPPaymentCardTextField: UIControl, UIKeyInput, STPFormTextFieldDeleg
func updatePostalFieldPlaceholder() {
if postalCodePlaceholder == nil {
postalCodeField.placeholder = defaultPostalFieldPlaceholder(forCountryCode: countryCode)
let placeholder = defaultPostalFieldPlaceholder(forCountryCode: countryCode)
postalCodeField.placeholder = placeholder
postalCodeField.accessibilityLabel = placeholder
} else {
postalCodeField.placeholder = postalCodePlaceholder
postalCodeField.accessibilityLabel = postalCodePlaceholder
}
}