angular-payments
angular-payments copied to clipboard
Validate digit and reorder test.
Fixes issue #49 and #51.
+1
+1
@alexismartin i've noticed that there's also a (mildly annoying but not fatal) issue when deleting the expiry date in firefox. The backslash is deleted on key down, but then re-added on press by the _formatForwardExpiry
handler method
line 333 needs to be changed from
if (/^\d\d$/.test(val)) {
to
if (/^\d\d$/.test(val) && /^\d+$/.test(digit)) {
That said, i can't actually see the purpose of the _formatForwardExpiry
handler method, as the existing conditional logic only equates to true when the delete key is being pressed. Otherwise _formatExpiry
deals with adding the forward slash as the user types.