hosted fields card number formatting - android
See original GitHub issueI have noticed an issue with the card number formatting in hosted fields on android devices.
If using the standard Google keyboard, auto formatting works fine, but other 3rd party keyboards can result in validation errors. I am using sdk v3.6.0.
For example, using the latest version of Chrome (54.0.2840.85) and the TouchPal keyboard, using the minimal example here: http://codepen.io/braintree/full/EKJVXp/
- Enter the card number
3530111333300000
- Note that spaces are not added automatically and the user can’t progress to the next step as validation is failing
- Press delete (backspace), and the auto formatting suddenly activates, but it deletes every 5th character and the last two, resulting in:
3530 1133 3000
- The card number will not pass validation unless the user adds the spaces manually
I have observed this behaviour with the following android keyboards (not an exhaustive list):
- TouchPal
- Samsung
- Sony Xperia (pressing delete does not activate auto formatting)
It looks like it is possibly related to this bug: https://bugs.chromium.org/p/chromium/issues/detail?id=118639
I think its fine if auto formatting doesn’t work with certain keyboards, but the following two issues result in a very frustrating customer experience:
- Auto formatting deletes characters from the card number if it activates late
- Card number validation requires spaces if auto formatting is active
Issue Analytics
- State:
- Created 7 years ago
- Reactions:4
- Comments:32 (10 by maintainers)
Top GitHub Comments
@stefanaerts We’ve just finished the work to fix this and are planning on releasing it today. We’ll update here when it’s out.
Yes, it’s a Motorola Nexus 6. “About Chrome” shows Android 7.0.0; Nexus 6 Build/NBD91J. Chrome 55.0.2883.91. The keyboard is “Swype + Dragon” 2.2.3.2020310.45082, “Midnight” theme; switching back to the default (?) “Material Dark” theme does not change it.
Here’s a recording: