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

Credit Card field issues on Android #21

Open
stuyam opened this issue Jan 9, 2017 · 7 comments
Open

Credit Card field issues on Android #21

stuyam opened this issue Jan 9, 2017 · 7 comments

Comments

@stuyam
Copy link

stuyam commented Jan 9, 2017

On Android is seems that the caret is reset to the beginning of the input when typing and it makes the credit card number enter backwards into the input. Here is the information that I have so far on the issue:

  • in chrome on android 4.3 and 5.1
  • on android 4.3, all numbers are entered backwards
  • on android 5.1, only the first and next number after a space is reversed

This also happens in the web view inside of apps on android. Has anyone else seen the issues of this? Is there a way we could detect that it won't work and abort payform on these devices that don't support it.

Thanks to everyone that contributes to this library it is awesome!

@jondavidjohn
Copy link
Owner

Bummer! Thanks for the report.

Would also appreciate any troubleshooting attempts since you may be closer to the problem.

@stuyam
Copy link
Author

stuyam commented Feb 6, 2017

So I wrote some logic in my own application to basically just drop formatting on android devices. Kind of a bummer but the formatting isn't the most important part. Plus I would rather have my users enter their card numbers correctly instead of them getting entered backwards and weird things happening with that.

With my basic search online I found it to be a big problem. It seems setting the caret position inside of inputs on android has been an issue for a while.

Here are related issues on other repos that are similar:
jQuery Mask: igorescobar/jQuery-Mask-Plugin#348
Input Mask: RobinHerbots/Inputmask#416
Masked Input: https://github.com/digitalBush/jquery.maskedinput/issues/382

Need to dig further into their solutions if any of them had a resolution. Needs more research.

@chrisnelson
Copy link

This might not be the same exact issue as I ran into, but see my commit on my fork which solved my issue where the caret positioning wasn't working on Chrome on Android on a Samsung phone.

chrisnelson/jquery.maskedinput@91d2082

@joe4mg
Copy link
Contributor

joe4mg commented Mar 24, 2017

In case anyone is looking for a quick fix - changing the input to type='tel' appears to stop this bug appearing on Android devices

@stuyam
Copy link
Author

stuyam commented Mar 24, 2017

Is that true @joe4mg I would be interested to test that out

@JesperWe
Copy link

JesperWe commented Apr 20, 2017

@joe4mg type="tel" does not solve the problem here (well it is nice with the tel keyboard, but caret position is still screwed up).

I can also confirm that the issue is still present after applying #26

@vishal1785
Copy link

@joe4mg I tried with input type="tel", it does fixes the issue for me.
Tested it on One plus 2, 3T and Nexus 5X device running OS versions > 6.0

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

6 participants