Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When you want to edit credit card number cursor should remain at the same position #23

Open
ecrisac opened this issue Jul 19, 2018 · 4 comments

Comments

@ecrisac
Copy link

ecrisac commented Jul 19, 2018

Steps to repro

  • type entire cc number then try to remove specific character somewhere in a middle , you will observe that cursor position will be changed to line end

expected result :
you should keep cursor position

Tested :
Was tested on demo page from here

@ecrisac ecrisac changed the title When you want to edit credit card number cursor position should remain the same When you want to edit credit card number cursor should remain at the same position Jul 19, 2018
@jxom
Copy link
Contributor

jxom commented Jul 19, 2018

Can't seem to reproduce this. What browser are you using?

@ecrisac
Copy link
Author

ecrisac commented Jul 19, 2018

I'm using Chrome 67.0.3396.99, try using amex card
card-input

@petevk
Copy link

petevk commented Oct 16, 2018

It seems to be only happening on amex cards because it is the only card with a different codepath (doesn't have a "global" regex pattern).

https://github.com/medipass/react-credit-card-input/blob/master/src/utils/formatter.js#L123-L125

@jxom
Copy link
Contributor

jxom commented May 26, 2019

We have just recently published a new library, React Payment Inputs which is a rewrite of react-credit-card-input, and fixes a lot of issues that were raised in this repository as well as a few extra enhancements.

Your issue that you raised here should be fixed in React Payment Inputs - however, if you wish to still use react-credit-card-inputs, I'll try find time to fix this issue in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants