Hi @nosir, thank you so much for this useful library!
Could you also improve it to allow dynamic input type?
For example, it could be great if in CreditCard mode user can see numeric keyboard on mobile.
Thanks in advance.
Hi, thanks for the like.
Does it show numeric keyboard with the demo in homepage for you? It is using type="tel"
It has type "text" there: https://jsfiddle.net/nosir/gLLsrxxf/
I use React, and input type "text" is hardcoded in Cleave.react.js (line 340).
I think it would be great if you will add relevant props for this feature :)
I also use cleave with react and would like to be able to show a numeric keyboard on mobile. Thanks!
I think this request makes a lot of sense, will add.
Hey @nosir I was actually able to get this to work by just adding the type attribute to my cleave component like this:
<Cleave
placeholder="Phone Number"
name="phonenumber"
type="tel"
options={{
numericOnly: true,
delimiters: ['-', '-'],
blocks: [3, 3, 4],
}}
onChange={this.handleInputChange.bind(this)}
/>
Hope this helps.
@kennycrosby, Ahh, I think I did something to transfer the rest of the props all the way down to the internal input.
Glad you pointed this out :)
I will close this, @maxdonetsk feel free to open if you have problem with passing down the type.
@kennycrosby @nosir Thanks guys, it works because of {...propsToTransfer} :) I didn't pay attention on it before.
Most helpful comment
Hey @nosir I was actually able to get this to work by just adding the type attribute to my cleave component like this:
Hope this helps.