RobinHerbots / Inputmask

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

autocomplete="one-time-code" and masked input #1985

Open erizoy opened 6 years ago

erizoy commented 6 years ago

Hello I'm using inputmask, and two-step auth in my project. But when I'm try to use autocomplete="one-time-code" for automatically get codes from iMessage, safari can't paste code with masked input. On inputs without mask it works as expected.

Code: $("#smscode").inputmask({"mask" : "999999", showMaskOnHover: false});

Safari 12.0 (14606.1.36.1.6) MacOS Mojave beta 10.14 (18A371a)

Dihlofos commented 5 years ago

Same trouble(

RobinHerbots commented 5 years ago

Which version do you use. I guess this is fixed in thé current beta 5.x. Can you have a try.

Op di 21 mei 2019 10:46 schreef Dihlofos notifications@github.com:

Same trouble(

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/RobinHerbots/Inputmask/issues/1985?email_source=notifications&email_token=AACNX33HYZN3NOFRHPPSOJ3PWOZHHA5CNFSM4FSOSZ6KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODV3GTVA#issuecomment-494299604, or mute the thread https://github.com/notifications/unsubscribe-auth/AACNX32G7KC55SNVF5HWHN3PWOZHHANCNFSM4FSOSZ6A .

Dihlofos commented 5 years ago

I tried beta version ("inputmask": "^5.0.0-beta.158") Not worked for me.

This is mask code: Inputmask({ "mask": "9999", clearMaskOnLostFocus: false, "oncomplete": function(){ codeinput.blur() } }).mask(codeinput);

I use it on input with type="tel", maybe it is crucial. But changing to type="text" hasn't solve problem.

Dihlofos commented 5 years ago

So, I solved the propblem! Atucomplete started to work when I added option "autoUnmask: true" to my mask init. Thank you for support!

RobinHerbots commented 5 years ago

@Dihlofos ,

Can you reproduce this in a codepen or jsFiddle? I would want to see why this option has impact on this when using a simple mask like 9999.

Best regards,

Robin

Dihlofos commented 5 years ago

@RobinHerbots,

So I was wrong. And the problem was not in "autoUnmask: true" rule. I just tested it in wrong browser. And as a result - autocomplete works fine in Iphone Chrome, but not works in Safari.