angular-payments
angular-payments copied to clipboard
Issue with Firefox and backspace on credit card number
When using Firefox, in a credit card number field, backspace erases numbers until it finds a space.
If your you try to erase at a space, it adds a character (String.fromCharCode(8), 8 being the keycode of backspace) instead of erasing the next number.
+1
+1
+1
+1
bump Has anyone been able to fix this issue?
I've got a PR open, and if you want to test it out, just update your bower.json to point to:
"angular-payments": "[email protected]:Fullscreen/angular-payments.git#ff-compat"
@8bitDesigner - Seems to work on Firefox 34.0.5
@8bitDesigner - :+1: - Would love to see your PR merged in
Ran into an issue with Chrome where the expiry month being parsed as NaN.

Ignore the previous comment, it was an issue that I introduced myself :-)
@strukturedkaos do you recall the reason for the error? Running into the NaN for exp_month error myself.
@irfaan - I had the stripe form in a partial. Once I moved it out of that partial, everything seemed to work.
Thanks, @strukturedkaos ! That might be it as mine is in a partial, as well. I'm just using the native Stripe as a fix.
+1
Give angular-credit-cards 2.3 a shot. I've added formatting that does a reasonably good job of getting the cursor position right without breaking out of Angular's native input handling events. It's quite consistent and simple for now which I think is best until I can really devote the time to aggressive cross-browser testing of a vanilla JS approach.
@8bitDesigner Your patch works for Firefox 31.2.0 on Linux.
+1. Also when you are trying to delete credit card number using backspace it stops after deleting symbol before divider. It just adds new symbol and then deletes it, and again and again. The cause of this bugs is the same.

Hey guys, any news about this issue?
guyssssss same problem
Same issue. Any fix available?
+1
+1 - I added this code to _formatCardNumber and _formatCVC functions and Firefox now allows backspacing.
if (e.keyCode === 46 || e.keyCode === 8||(e.keyCode >=37 && e.keyCode <=40)) { return; }
I also changed this line: if (!/^\d+$/.test(digit) && !e.meta && e.keyCode >= 46) { to use: if (!/^\d+$/.test(digit) && !e.meta && e.which >= 46) {