angular-payments icon indicating copy to clipboard operation
angular-payments copied to clipboard

Issue with Firefox and backspace on credit card number

Open alexismartin opened this issue 11 years ago • 22 comments

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.

alexismartin avatar Sep 09 '14 09:09 alexismartin

+1

monospaced avatar Oct 17 '14 09:10 monospaced

+1

caseyjhol avatar Oct 19 '14 05:10 caseyjhol

+1

mongkok avatar Oct 28 '14 22:10 mongkok

+1

barszczmm avatar Nov 15 '14 10:11 barszczmm

bump Has anyone been able to fix this issue?

strukturedkaos avatar Jan 05 '15 01:01 strukturedkaos

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 avatar Jan 14 '15 21:01 8bitDesigner

@8bitDesigner - Seems to work on Firefox 34.0.5

strukturedkaos avatar Jan 23 '15 18:01 strukturedkaos

@8bitDesigner - :+1: - Would love to see your PR merged in

strukturedkaos avatar Jan 23 '15 18:01 strukturedkaos

Ran into an issue with Chrome where the expiry month being parsed as NaN.

image

strukturedkaos avatar Jan 23 '15 18:01 strukturedkaos

Ignore the previous comment, it was an issue that I introduced myself :-)

strukturedkaos avatar Jan 23 '15 19:01 strukturedkaos

@strukturedkaos do you recall the reason for the error? Running into the NaN for exp_month error myself.

irfaan avatar Jan 25 '15 07:01 irfaan

@irfaan - I had the stripe form in a partial. Once I moved it out of that partial, everything seemed to work.

strukturedkaos avatar Jan 25 '15 16:01 strukturedkaos

Thanks, @strukturedkaos ! That might be it as mine is in a partial, as well. I'm just using the native Stripe as a fix.

irfaan avatar Jan 26 '15 05:01 irfaan

+1

4141done avatar Jan 29 '15 00:01 4141done

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.

bendrucker avatar May 04 '15 14:05 bendrucker

@8bitDesigner Your patch works for Firefox 31.2.0 on Linux.

amc1804 avatar Jun 15 '15 06:06 amc1804

+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. anguar-payments-issue

RayzRazko avatar Jul 01 '15 15:07 RayzRazko

Hey guys, any news about this issue?

danieleleoni avatar Jul 15 '16 13:07 danieleleoni

guyssssss same problem

Matteobikk90 avatar Mar 31 '17 14:03 Matteobikk90

Same issue. Any fix available?

prijindev avatar May 08 '17 10:05 prijindev

+1

MatissJanis avatar May 08 '17 13:05 MatissJanis

+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) {

jaysontvjohnson avatar Aug 11 '17 14:08 jaysontvjohnson