Text-mask: Allow to use the mask with other input types

Created on 16 Jun 2016  路  6Comments  路  Source: text-mask/text-mask

The only type that works is text.
Specially on mobile, it'd be nice to set the type of the input in order to show the correct keyboard.

question

All 6 comments

@gabrielamarques It should work work on types other than text. There is no restriction on that, as far as I can tell.

@msafi I was having trouble setting the type to number so I have checked again: I have found out that the problem is with selectionStart, which only works with text, search, tel, url and password as you can look here.

@gabrielamarques That's interesting. Thanks for sharing this info. How about showing a numeric keyboard for a text input, is that possible? There's a question on StackOverflow about that http://stackoverflow.com/questions/6178556/phone-numeric-keyboard-for-text-input/37799101#37799101

Any updates for this issue? :)

@andys8 nothing has changed in this space.. if you would like to request a change please open a new issue with some more info..

Thanks for the quick reply. I found out Cleave.js is using <input type="tel"> on their demo site to show the numpad on mobile devices. Not the best, but seems to be the only working solution. If it's possible with text-mask too, it could be a good idea to add an example to the demo page.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

refo picture refo  路  6Comments

douglasdtc picture douglasdtc  路  3Comments

danvc picture danvc  路  5Comments

KevinGruber picture KevinGruber  路  6Comments

msafi picture msafi  路  6Comments