Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Trim whitespace from STPAddressFieldTableViewCell contents when readi…
…ng the property. Fixes a user-interaction issue (knowingly) introduced by #870. When selecting email or zip code autocompletion suggestions, they fail validation. US zip codes would fail immediately, while email addresses waited until the field lost focus. This was an unpleasant UX experience. This is both a very concise fix, but also one I like. It keeps the contents of the text field unchanged, and does not interfere with editing in any way. Leading & trailing spaces are simply ignored while validating, and they are likewise ignored when considering what the logical contents of the cell/text field are. This results in the trimmed string being persisted to the server, and the trimmed string being passed around the payment context (like copying to the other address type)
- Loading branch information