RobinHerbots / Inputmask

Input Mask plugin
https://robinherbots.github.io/Inputmask/
MIT License
6.39k stars 2.17k forks source link

Not working on Android phone. #1568

Open ruzhuo opened 7 years ago

ruzhuo commented 7 years ago

I use jquery.inputmask.bundle.min.js . It works on most browser very well. But it won't work on Android phone with Chrome for date mask "mm/dd/yyyy".

sahanDissanayake commented 7 years ago

👍 same issue here..

RobinHerbots commented 7 years ago

@ruzhuo , @sahanDissanayake ,

I need way more details.
Version of android, version of browser, keyboard used. Exact problem.

RandomDude777 commented 7 years ago

On the latest build of android (haven't tested below) using google's keyboard when typing in fields (only tested with regex) when I hit space the cursor gets locked in-front of the space and the text types backwards and entirely renders it unusable (I've had to disable the lib in production) tested on multiple android devices of the same version.

a space is required to replicate this bug.

form.find('[name=name]').inputmask("Regex", { regex: "[a-zA-Z ]{25}", });

liamjar4s commented 7 years ago

Seeing the issue with the following user agent:

Mozilla/5.0 (Linux; Android 7.0; SM-G935F Build/NRD90M) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.83 Mobile Safari/537.36

I've reproduced it on the Galaxy S7 device on Browserstack using the stock Chrome and keyboard setup.

The following input reproduced the issue:

https://jsfiddle.net/5o4k0b3t/4/

if you attempt to type 1234 into the input using the onscreen keyboard, you'll get 12-43 in the text area.

RobinHerbots commented 6 years ago

@liamjar4s ,

Can you retry with https://jsfiddle.net/5o4k0b3t/11/

RobinHerbots commented 6 years ago

@RandomDude777 ,

If you have some time to retest with the current version. Your feedback is welcome.

liamjar4s commented 6 years ago

@RobinHerbots That's solved it for me. Thanks Robin!

liamjar4s commented 6 years ago

@RobinHerbots I've tested with spaces and it appears to fix your issue too, @RandomDude777.

RobinHerbots commented 6 years ago

@liamjar4s ,

I guess we can close this issue.

RandomDude777 commented 6 years ago

I haven't had time to test (I will do soon) do the new fix's account for autocomplete?

RobinHerbots commented 6 years ago

@RandomDude777 ,

Added your mask for convenience. https://jsfiddle.net/5o4k0b3t/14/

I added the androidHack to disable predictive text.