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

Support for Android default browser #368

Closed
RobinHerbots opened this issue Oct 29, 2013 · 15 comments
Closed

Support for Android default browser #368

RobinHerbots opened this issue Oct 29, 2013 · 15 comments
Labels
Milestone

Comments

@RobinHerbots
Copy link
Owner

No description provided.

@RobinHerbots
Copy link
Owner Author

Someone has a problem with the stock browser?

@FransVDB
Copy link

Hi Robin,
I've tested the inputmask plugin on my Android smartphone (Sony Xperia Mini Pro, Android 4.0.4) and the plugin doesn't work on the stock browser. The software and hardware keyboards don't type anything in inputfields that have a mask.
Textfields with masks work as expected though.

I've done some debugging, and it seems that the jquery keyup, keydown and keypress events aren't fired on input fields.
However, when you apply a numeric mask, the events are fired after all...

Example
This doesn't work:
$("#test1").inputmask("**** **** **** ****");

This works fine:
$("#test2").inputmask("decimal", { "radixPoint": ",", "autoGroup": true, "groupSeparator": ".", "groupSize": 3 , "digits": 2});

Can anyone else confirm this?

@RobinHerbots RobinHerbots reopened this Nov 14, 2013
@RobinHerbots
Copy link
Owner Author

@FransVDB,

Thx for the feedback!

I will have a look.

@RobinHerbots
Copy link
Owner Author

@FransVDB ,

Can you sent the useragent string?

@FransVDB
Copy link

@RobinHerbots
Mozilla/5.0 (Linux; U; Android 4.0.4; nl-be; SonyEricssonSK17i Build/4.1.B.0.587) AppleWebkit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30

Done some more testing today, some masks seem to work, others don't. I'll post a jsfiddle example later.

@FransVDB
Copy link

@RobinHerbots

I found the problem. If you set the maxlength property of an inputfield as the same length of the mask (or less), none of the keyboard events get fired. Propably because the character is added in the inputfield first, and then the placeholder gets deleted, this would cause the length of the string to be longer then the maxlength, so the events won't fire.

This only happens on Android though, no other browsers I've tested seem to have this problem.

I made a jsfiddle example: http://jsfiddle.net/4ta2K/

Sorry if I caused any confusion, your plugin does fully work on Android, just don't set the maxlength property :)

@RobinHerbots
Copy link
Owner Author

@FransVDB,

Now they will both work on android stock browser.
See latest tweak in js.jquery.inputmask

You can verify in the jsfiddle example.

@FransVDB
Copy link

Alright, it works now. Thanks for the fix!

But I ran into another issue, the auto-suggest or auto-complete feature of the keyboard messes up the mask when typing. If I turn off auto suggest, everything works perfectly.
It seems like the auto-suggest feature inserts multiple characters at once, and the plugin doesn't delete the wrong ones.

I tried this, but no luck so far.
input type="text" id="test" autocomplete="off" autocorrect="off" autocapitalize="off" autosuggest="off" spellcheck="false"

@RobinHerbots
Copy link
Owner Author

@FransVDB,

I will need to listen to the input event for android devices. For Mobile Chrome it already does.

@RobinHerbots RobinHerbots reopened this Nov 15, 2013
@Talkless
Copy link

Talkless commented Dec 2, 2013

I have problem inside Cordova application in Android 2.2 and 2.3.3. I guess it's using default Android browser..?

Take a look:

http://i.imgur.com/CsFNffw.png

I've wrote comment there (maybe I've better wrote it here..?):
#28 (comment)

@RobinHerbots
Copy link
Owner Author

@Talkless ,

Thx for the feedback.

I will have a look at it later.

@Enfree
Copy link
Contributor

Enfree commented Oct 7, 2015

Reproduced again. Take a look:
http://jsfiddle.net/qmfkt3aq/3/
No keydown/keyup events fires. Was tested under android default browser version 4.2.2(was reproduced), but under 5.2 browser version all works fine.

@RobinHerbots
Copy link
Owner Author

@Enfree ,

Are you sure it works under 5.2? Or is just the ime autosuggest disabled?

@Enfree
Copy link
Contributor

Enfree commented Oct 9, 2015

@RobinHerbots,
Sorry, probably the fiddle was bad :( . Thats new one: http://jsfiddle.net/ovymcefh/
Was tested on Android default browsers under:
LG D410 (browser version 5.2.34) inputs works
OnePlus 1 (5.1.1) inputs works
Philips W3568 (4.2.2) first input doesnt work
Samsung GT-S 7562 (4.0.4) first input doesnt work

Reproducing doesnt depends on autosuggest.

@RobinHerbots RobinHerbots reopened this Oct 9, 2015
@RobinHerbots RobinHerbots modified the milestones: 3.3, 2.5 Oct 9, 2015
@RobinHerbots RobinHerbots removed their assignment Dec 24, 2015
@time-wcrp
Copy link

Many thank.

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

No branches or pull requests

5 participants